Mercurial > hg > orthanc-stone
comparison OrthancStone/Resources/Orthanc/CMake/EmscriptenParameters.cmake @ 1918:fc6009c43bd9
sync
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 21 Mar 2022 12:12:25 +0100 |
parents | 9c52c0376ad7 |
children | f4cdcba8c32a |
comparison
equal
deleted
inserted
replaced
1917:9c52c0376ad7 | 1918:fc6009c43bd9 |
---|---|
22 # https://github.com/emscripten-core/emscripten/blob/master/src/settings.js | 22 # https://github.com/emscripten-core/emscripten/blob/master/src/settings.js |
23 | 23 |
24 if (NOT "${EMSCRIPTEN_TRAP_MODE}" STREQUAL "") | 24 if (NOT "${EMSCRIPTEN_TRAP_MODE}" STREQUAL "") |
25 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s BINARYEN_TRAP_MODE='\"${EMSCRIPTEN_TRAP_MODE}\"'") | 25 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s BINARYEN_TRAP_MODE='\"${EMSCRIPTEN_TRAP_MODE}\"'") |
26 endif() | 26 endif() |
27 | |
28 # If "-O3" is used (the default in "Release" mode), this results in a | |
29 # too large memory consumption in "wasm-opt", at least in Emscripten | |
30 # 3.1.7, which ultimately crashes the compiler. So we force "-O2" | |
31 # (this also has the advantage of speeding up the build): | |
32 set(CMAKE_CXX_FLAGS_RELEASE "-O2") | |
27 | 33 |
28 # "DISABLE_EXCEPTION_CATCHING" is a "compile+link" option. HOWEVER, | 34 # "DISABLE_EXCEPTION_CATCHING" is a "compile+link" option. HOWEVER, |
29 # setting it inside "WASM_FLAGS" creates link errors, at least with | 35 # setting it inside "WASM_FLAGS" creates link errors, at least with |
30 # side modules. TODO: Understand why | 36 # side modules. TODO: Understand why |
31 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s DISABLE_EXCEPTION_CATCHING=0") | 37 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s DISABLE_EXCEPTION_CATCHING=0") |