()
| 219 | |
| 220 | |
| 221 | def main(): |
| 222 | tool_name = Path(sys.argv[0]).name |
| 223 | if tool_name.endswith(".py"): |
| 224 | if len(sys.argv) < 2: |
| 225 | print("Missing MSVC tool name", file=sys.stderr) |
| 226 | return 1 |
| 227 | tool_name = sys.argv[1] |
| 228 | arguments = sys.argv[2:] |
| 229 | else: |
| 230 | arguments = sys.argv[1:] |
| 231 | |
| 232 | script_path = Path(__file__).resolve() |
| 233 | root = script_path.parents[2] |
| 234 | wine_prefix = root / ".wine-prefix" |
| 235 | wine_prefix.mkdir(parents=True, exist_ok=True) |
| 236 | target_arch = resolve_target_arch(script_path) |
| 237 | |
| 238 | _, wine, msvc_root, sdk_root, sdk_version = resolve_layout(root) |
| 239 | environment = build_environment(root, wine_prefix, wine, msvc_root, sdk_root, sdk_version, target_arch) |
| 240 | prepare_prefix_headless(root, wine, environment) |
| 241 | |
| 242 | executable = posix_to_windows(str(tool_executable(msvc_root, target_arch, tool_name))) |
| 243 | converted_arguments = [convert_argument(argument) for argument in arguments] |
| 244 | return subprocess.call([wine, executable, *converted_arguments], env=environment) |
| 245 | |
| 246 | |
| 247 | if __name__ == "__main__": |
no test coverage detected