MCPcopy
hub / github.com/emscripten-core/emsdk / build_ninja

Function build_ninja

emsdk.py:1184–1216  ·  view source on GitHub ↗
(tool)

Source from the content-addressed store, hash-verified

1182
1183
1184def build_ninja(tool):
1185 debug_print(f'build_ninja({tool})')
1186 root = os.path.normpath(tool.installation_path())
1187 src_root = os.path.join(root, 'src')
1188 success = git_clone_checkout_and_pull(tool.download_url(), src_root, tool.git_branch)
1189 if not success:
1190 return False
1191
1192 build_dir = llvm_build_dir(tool)
1193 build_root = os.path.join(root, build_dir)
1194
1195 build_type = decide_cmake_build_type(tool)
1196
1197 # Configure
1198 cmake_generator, args = get_generator_and_config_args(tool)
1199
1200 cmakelists_dir = os.path.join(src_root)
1201
1202 success = cmake_configure_and_build(cmake_generator, build_root, cmakelists_dir, build_type, args)
1203
1204 if success:
1205 bin_dir = os.path.join(root, 'bin')
1206 mkdir_p(bin_dir)
1207 exe_paths = [os.path.join(build_root, 'Release', 'ninja'), os.path.join(build_root, 'ninja')]
1208 for e in exe_paths:
1209 for s in ['.exe', '']:
1210 ninja = e + s
1211 if os.path.isfile(ninja):
1212 dst = os.path.join(bin_dir, 'ninja' + s)
1213 shutil.copyfile(ninja, dst)
1214 os.chmod(dst, os.stat(dst).st_mode | stat.S_IEXEC)
1215
1216 return success
1217
1218
1219def build_ccache(tool):

Callers

nothing calls this directly

Calls 9

debug_printFunction · 0.85
llvm_build_dirFunction · 0.85
decide_cmake_build_typeFunction · 0.85
mkdir_pFunction · 0.85
installation_pathMethod · 0.80
download_urlMethod · 0.80

Tested by

no test coverage detected