comparison Resources/CMake/Compiler.cmake @ 2510:04873915beaf

configuration of DCMTK for WebAssembly
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 28 Mar 2018 14:14:37 +0200
parents 808fd5218f56
children 13038d638097
comparison
equal deleted inserted replaced
2509:9d9f2d088dce 2510:04873915beaf
172 link_libraries(iconv) 172 link_libraries(iconv)
173 173
174 elseif (CMAKE_SYSTEM_NAME STREQUAL "Emscripten") 174 elseif (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
175 message("Building using Emscripten (for WebAssembly or asm.js targets)") 175 message("Building using Emscripten (for WebAssembly or asm.js targets)")
176 176
177 # The BINARYEN_TRAP_MODE specifies what to do when divisions per
178 # zero (and similar conditions like integer overflows) are
179 # encountered: The "clamp" mode avoids throwing errors, as they
180 # cannot be properly catched by "try {} catch (...)" constructions.
181 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s EXTRA_EXPORTED_RUNTIME_METHODS='[\"ccall\", \"cwrap\"]' -s BINARYEN_TRAP_MODE='\"clamp\"'")
182
177 else() 183 else()
178 message(FATAL_ERROR "Support your platform here") 184 message(FATAL_ERROR "Support your platform here")
179 endif() 185 endif()
180 186
181 187