Skip to content

Commit

Permalink
Workaround Emscripten CMake issue
Browse files Browse the repository at this point in the history
-fexceptions causes some issues: emscripten-core/emscripten#18084

After trial and error it seems that moving them to apply only to C++ (via CXXFLAGS) works best.
  • Loading branch information
RReverser committed Oct 28, 2022
1 parent dad64c8 commit a29cee0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ if [ "$PIC" = "true" ]; then PIC_FLAG=--pic; fi
#export LDFLAGS+=" --source-map-base http://localhost:3000/lib/"

# Common compiler flags
export CFLAGS="-O3 -fno-rtti -fexceptions -mnontrapping-fptoint -pthread"
export CFLAGS="-O3 -fno-rtti -mnontrapping-fptoint -pthread"
if [ "$SIMD" = "true" ]; then export CFLAGS+=" -msimd128 -DWASM_SIMD_COMPAT_SLOW"; fi
if [ "$WASM_BIGINT" = "true" ]; then
# libffi needs to detect WASM_BIGINT support at compile time
Expand All @@ -108,7 +108,7 @@ if [ "$WASM_FS" = "true" ]; then export CFLAGS+=" -DWASMFS"; fi
if [ "$WASM_EH" = "true" ]; then export CFLAGS+=" -sSUPPORT_LONGJMP=wasm"; fi
if [ "$LTO" = "true" ]; then export CFLAGS+=" -flto"; fi
if [ "$PIC" = "true" ]; then export CFLAGS+=" -fPIC"; fi
export CXXFLAGS="$CFLAGS"
export CXXFLAGS="$CFLAGS -fexceptions"
export LDFLAGS="-L$TARGET/lib -O3"
if [ "$WASM_BIGINT" = "true" ]; then export LDFLAGS+=" -sWASM_BIGINT"; fi
if [ "$WASM_FS" = "true" ]; then export LDFLAGS+=" -sWASMFS"; fi
Expand Down

0 comments on commit a29cee0

Please sign in to comment.