MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / run

Function run

emmake.py:37–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

35# Main run() function
36#
37def run():
38 if len(sys.argv) < 2 or sys.argv[1] in {'--version', '--help'}:
39 print(''&#x27;\
40emmake is a helper for make, setting various environment
41variables so that emcc etc. are used. Typical usage:
42
43 emmake make [FLAGS]
44
45(but you can run any command instead of make)''&#x27;, file=sys.stderr)
46 return 1
47
48 args = sys.argv[1:]
49 env = building.get_building_env()
50
51 # On Windows prefer building with mingw32-make instead of make, if it exists.
52 if utils.WINDOWS:
53 if args[0] == 'make':
54 mingw32_make = shutil.which('mingw32-make')
55 if mingw32_make:
56 args[0] = mingw32_make
57
58 # On Windows, run the execution through shell to get PATH expansion and
59 # executable extension lookup, e.g. 'make' will match with
60 # 'make.bat' in PATH.
61 print(f'emmake: "{shlex.join(args)}" in "{os.getcwd()}"', file=sys.stderr)
62 if utils.WINDOWS:
63 return utils.run_process(args, check=False, shell=True, env=env).returncode
64 else:
65 os.environ.update(env)
66 utils.exec(args)
67
68
69if __name__ == '__main__':

Callers 1

emmake.pyFile · 0.70

Calls 4

run_processMethod · 0.80
updateMethod · 0.80
printFunction · 0.50
joinMethod · 0.45

Tested by

no test coverage detected