Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toolchain: make emscripten toolchain work with rules_foreign_cc #16

Merged
merged 1 commit into from
May 1, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 9 additions & 5 deletions toolchain/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,20 @@ if [[ "$OSTYPE" == "linux-gnu" ]]; then
cd -P /proc/self/cwd
fi

TOOLCHAIN_ROOT=${EXT_BUILD_ROOT:-$PWD}

export NODE_JS=''
export EMSCRIPTEN_ROOT='external/emscripten_toolchain'
export EMSCRIPTEN_ROOT="${TOOLCHAIN_ROOT}/external/emscripten_toolchain"
export SPIDERMONKEY_ENGINE=''
export EM_EXCLUSIVE_CACHE_ACCESS=1
export EMCC_SKIP_SANITY_CHECK=1
export EMCC_WASM_BACKEND=1

source external/emscripten_toolchain/emsdk_env.sh
#echo "$(pwd)/external/emscripten_toolchain/emsdk_env.sh"
#realpath "external/emscripten_toolchain/emsdk_env.sh"
source "${EMSCRIPTEN_ROOT}/emsdk_env.sh"

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