File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ Options:
1818
1919 CMAKE_TOOLCHAIN_FILE=|...
2020
21- CC=cc|gcc|clang|...
22- CXX=c++|g++|clang++|...
21+ CC=cc|gcc|clang|emcc| ...
22+ CXX=c++|g++|clang++|emcc| ...
2323
2424 CLEAN=0|1
2525
@@ -51,6 +51,19 @@ BUILD_DIR=".build"
5151
5252# Compiler
5353
54+ if [ " $CC " = emcc ] || [ " $CXX " = emcc ]; then
55+ if [ -z " $CMAKE_TOOLCHAIN_FILE " ] \
56+ && [ -n " $EMSDK " ] \
57+ && [ -f " $EMSDK /upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake" ] \
58+ && command -v emcc > /dev/null; then
59+ CMAKE_TOOLCHAIN_FILE=" $EMSDK /upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake"
60+ CC=' '
61+ CXX=' '
62+ else
63+ >&2 echo " WARNING: emcc specified, but EMSDK does not seem to be available."
64+ fi
65+ fi
66+
5467if [ -n " $CMAKE_TOOLCHAIN_FILE " ]; then
5568 GENERATE_CMD+=(" -DCMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN_FILE " )
5669
Original file line number Diff line number Diff line change @@ -135,9 +135,8 @@ run-tests() {
135135 if [ " $TRAVIS_OS_NAME " != windows ] && [ " $EMSCRIPTEN " = 1 ]; then
136136 folded-finish EMSCRIPTEN_INSTALL_PID
137137 folded " Sourcing Emscripten environment" . .build-emsdk/emsdk_env.sh
138- local EMSCRIPTEN_TOOLCHAIN_FILE=" $EMSDK /upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake"
139138 for CONFIG in Debug Release; do
140- CMAKE_BUILD_TYPE=$CONFIG CMAKE_TOOLCHAIN_FILE= " $EMSCRIPTEN_TOOLCHAIN_FILE " CC=' ' CXX=' ' folded " Emscripten $CONFIG " cppsm test
139+ CMAKE_BUILD_TYPE=$CONFIG CC=emcc CXX=emcc folded " Emscripten $CONFIG " cppsm test
141140 done
142141 fi
143142}
You can’t perform that action at this time.
0 commit comments