Skip to content

Commit 9113382

Browse files
authored
toolchain: make emscripten toolchain work with rules_foreign_cc (#16)
Signed-off-by: Lizan Zhou <[email protected]>
1 parent c727651 commit 9113382

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

toolchain/common.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,20 @@ if [[ "$OSTYPE" == "linux-gnu" ]]; then
2020
cd -P /proc/self/cwd
2121
fi
2222

23+
TOOLCHAIN_ROOT=${EXT_BUILD_ROOT:-$PWD}
24+
2325
export NODE_JS=''
24-
export EMSCRIPTEN_ROOT='external/emscripten_toolchain'
26+
export EMSCRIPTEN_ROOT="${TOOLCHAIN_ROOT}/external/emscripten_toolchain"
2527
export SPIDERMONKEY_ENGINE=''
2628
export EM_EXCLUSIVE_CACHE_ACCESS=1
2729
export EMCC_SKIP_SANITY_CHECK=1
2830
export EMCC_WASM_BACKEND=1
2931

30-
source external/emscripten_toolchain/emsdk_env.sh
32+
#echo "$(pwd)/external/emscripten_toolchain/emsdk_env.sh"
33+
#realpath "external/emscripten_toolchain/emsdk_env.sh"
34+
source "${EMSCRIPTEN_ROOT}/emsdk_env.sh"
3135

3236
# the emscripten sdk does some path comparison, so make EM_CACHE an absolute path to make it work.
33-
mkdir -p "tmp/emscripten_cache"
34-
export EM_CACHE=${PWD}"/tmp/emscripten_cache"
35-
export TEMP_DIR="tmp"
37+
mkdir -p "${TOOLCHAIN_ROOT}/tmp/emscripten_cache"
38+
export EM_CACHE="${TOOLCHAIN_ROOT}/tmp/emscripten_cache"
39+
export TEMP_DIR="${TOOLCHAIN_ROOT}/tmp"

0 commit comments

Comments
 (0)