MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / main

Function main

Tools/Support/PortableMSVCWrapper.py:221–244  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

219
220
221def 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
247if __name__ == "__main__":

Callers 1

Calls 8

printFunction · 0.85
resolve_target_archFunction · 0.85
resolve_layoutFunction · 0.85
build_environmentFunction · 0.85
tool_executableFunction · 0.85
convert_argumentFunction · 0.85
prepare_prefix_headlessFunction · 0.70
posix_to_windowsFunction · 0.70

Tested by

no test coverage detected