2020-09-10 21:42:46 -04:00
|
|
|
import os
|
2021-01-27 03:17:30 +08:00
|
|
|
import platform
|
2020-09-10 21:42:46 -04:00
|
|
|
|
|
|
|
|
ROOT_DIR = os.environ["ROOT_DIR"]
|
|
|
|
|
EMSCRIPTEN_ROOT = os.environ["EMSCRIPTEN"]
|
2022-04-27 13:13:53 -04:00
|
|
|
BINARYEN_ROOT = os.path.join(ROOT_DIR, os.environ["EM_BIN_PATH"])
|
|
|
|
|
LLVM_ROOT = os.path.join(BINARYEN_ROOT, "bin")
|
2021-01-29 18:25:41 -08:00
|
|
|
FROZEN_CACHE = True
|
2021-01-27 03:17:30 +08:00
|
|
|
|
|
|
|
|
system = platform.system()
|
2022-02-11 11:18:16 -08:00
|
|
|
|
2023-03-30 21:43:42 +02:00
|
|
|
machine = "arm64" if platform.machine() in ('arm64', 'aarch64') else "amd64"
|
2021-12-20 11:24:56 -08:00
|
|
|
nodejs_binary = "bin/nodejs/node.exe" if(system =="Windows") else "bin/node"
|
2022-02-11 11:18:16 -08:00
|
|
|
NODE_JS = ROOT_DIR + "/external/nodejs_{}_{}/{}".format(system.lower(), machine, nodejs_binary)
|
2022-04-27 13:13:53 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
# This works around an issue with Bazel RBE where the symlinks in node_modules/.bin
|
|
|
|
|
# are uploaded as the linked files, which means the cli.js cannot load its
|
|
|
|
|
# dependencies from the expected locations.
|
|
|
|
|
# See https://github.com/emscripten-core/emscripten/pull/16640 for more
|
|
|
|
|
if system != "Windows":
|
|
|
|
|
CLOSURE_COMPILER = [NODE_JS, os.path.join(EMSCRIPTEN_ROOT, "node_modules",
|
|
|
|
|
"google-closure-compiler", "cli.js")]
|