Skip to content

Commit

Permalink
COMP: provide option to disable use of float exception macros
Browse files Browse the repository at this point in the history
Emscripten and WASI throw "undefined symbol" error on float
exception macros such as FE_INVALID. Provide a flag to
disable the use of such macros when building ITK/DCMTK with
unconventional compilers such as emscripten and wasi.
  • Loading branch information
jadh4v authored and bourdaisj committed May 15, 2024
1 parent 4e37480 commit 0395086
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Modules/ThirdParty/DCMTK/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,12 @@ endforeach()
if(CMAKE_CROSSCOMPILING_EMULATOR)
list(APPEND _cross_compiling_flags -DCMAKE_CROSSCOMPILING_EMULATOR:FILEPATH=${CMAKE_CROSSCOMPILING_EMULATOR})
endif()

set(DCMTK_CXX_FLAGS ${CMAKE_CXX_FLAGS})
if(NO_FLOAT_EXCEPTIONS)
string(APPEND DCMTK_CXX_FLAGS " -DNO_FLOAT_EXCEPTIONS")
endif()

itk_download_attempt_check(${DCMTK_EPNAME})
ExternalProject_Add(${DCMTK_EPNAME}
GIT_REPOSITORY ${DCMTK_GIT_REPOSITORY}
Expand Down Expand Up @@ -328,6 +334,7 @@ endforeach()
-DCMAKE_INSTALL_LIBDIR:PATH=${CMAKE_INSTALL_LIBDIR}
-DCMAKE_INSTALL_BINDIR:PATH=${CMAKE_INSTALL_BINDIR}
-DDCMTK_ENABLE_BUILTIN_OFICONV_DATA:BOOL=${DCMTK_ENABLE_BUILTIN_OFICONV_DATA}
-DCMAKE_CXX_FLAGS:STRING=${DCMTK_CXX_FLAGS}
${CHARSET_CONVERSION_ARGS}
DEPENDS ${JPEG_DEPENDENCY} ${PNG_DEPENDENCY} ${TIFF_DEPENDENCY} ${ICU_DEPENDENCY}
BUILD_BYPRODUCTS ${DCMTK_BYPRODUCTS}
Expand Down

0 comments on commit 0395086

Please sign in to comment.