MCPcopy Index your code
hub / github.com/emscripten-core/emsdk / build_ccache

Function build_ccache

emsdk.py:1219–1259  ·  view source on GitHub ↗
(tool)

Source from the content-addressed store, hash-verified

1217
1218
1219def build_ccache(tool):
1220 debug_print(f'build_ccache({tool})')
1221 root = os.path.normpath(tool.installation_path())
1222 src_root = os.path.join(root, 'src')
1223 success = git_clone_checkout_and_pull(tool.download_url(), src_root, tool.git_branch)
1224 if not success:
1225 return False
1226
1227 build_dir = llvm_build_dir(tool)
1228 build_root = os.path.join(root, build_dir)
1229
1230 build_type = decide_cmake_build_type(tool)
1231
1232 # Configure
1233 cmake_generator, args = get_generator_and_config_args(tool)
1234 args += ['-DZSTD_FROM_INTERNET=ON']
1235
1236 cmakelists_dir = os.path.join(src_root)
1237
1238 success = cmake_configure_and_build(cmake_generator, build_root, cmakelists_dir, build_type, args)
1239
1240 if success:
1241 bin_dir = os.path.join(root, 'bin')
1242 mkdir_p(bin_dir)
1243 exe_paths = [os.path.join(build_root, 'Release', 'ccache'), os.path.join(build_root, 'ccache')]
1244 for e in exe_paths:
1245 for s in ['.exe', '']:
1246 ccache = e + s
1247 if os.path.isfile(ccache):
1248 dst = os.path.join(bin_dir, 'ccache' + s)
1249 shutil.copyfile(ccache, dst)
1250 os.chmod(dst, os.stat(dst).st_mode | stat.S_IEXEC)
1251
1252 cache_dir = os.path.join(root, 'cache')
1253 open(os.path.join(root, 'emcc_ccache.conf'), 'w').write('''# Set maximum cache size to 10 GB:
1254max_size = 10G
1255cache_dir = %s
1256''' % cache_dir)
1257 mkdir_p(cache_dir)
1258
1259 return success
1260
1261
1262def download_firefox(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