Skip to content

Commit ed899a9

Browse files
committed
build(ITKWebAssemblyInterface): do not pass emscripten flags with wasi
-Wno-warn-absolute-pathn and -DITK_WASM_NO_FILESYSTEM are only for emscription.
1 parent aae9550 commit ed899a9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/docker/itk-wasm/ITKWebAssemblyInterface.cmake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ function(add_executable target)
4040
set(wasm_target ${target})
4141
_add_executable(${wasm_target} ${ARGN})
4242
# Suppress CLI11 Encoding_inl.hpp std::wstring_convert deprecation warning
43-
set_property(TARGET ${wasm_target} APPEND PROPERTY COMPILE_OPTIONS -msimd128 -flto -Wno-warn-absolute-paths -Wno-deprecated-declarations -DITK_WASM_NO_FILESYSTEM_IO)
43+
set_property(TARGET ${wasm_target} APPEND PROPERTY COMPILE_OPTIONS -msimd128 -flto -Wno-deprecated-declarations)
4444
if(EMSCRIPTEN)
45+
set_property(TARGET ${wasm_target} APPEND PROPERTY COMPILE_OPTIONS -Wno-warn-absolute-paths -DITK_WASM_NO_FILESYSTEM_IO)
4546
kebab_to_camel(${target} targetCamel)
4647
get_property(_link_flags TARGET ${target} PROPERTY LINK_FLAGS)
4748
set(common_link_flags "-flto -s ALLOW_MEMORY_GROWTH=1 -s MAXIMUM_MEMORY=4GB -s FORCE_FILESYSTEM=1 -s EXPORTED_RUNTIME_METHODS='[\"callMain\",\"cwrap\",\"ccall\",\"writeArrayToMemory\",\"lengthBytesUTF8\",\"stringToUTF8\",\"UTF8ToString\", \"stackSave\", \"stackRestore\"]' -flto -s ALLOW_MEMORY_GROWTH=1 -s MAXIMUM_MEMORY=4GB -s WASM=1 -lnodefs.js -s WASM_ASYNC_COMPILATION=1 -s EXPORT_NAME=${targetCamel} -s MODULARIZE=1 -s EXIT_RUNTIME=0 -s INVOKE_RUN=0 --pre-js /ITKWebAssemblyInterface/src/emscripten-module/itkJSPipelinePre.js --post-js /ITKWebAssemblyInterface/src/emscripten-module/itkJSPost.js -s ERROR_ON_UNDEFINED_SYMBOLS=0 -s EXPORTED_FUNCTIONS='[\"_main\"]' ${_link_flags}")
@@ -74,7 +75,7 @@ function(add_executable target)
7475
get_property(_is_imported TARGET ${wasm_target} PROPERTY IMPORTED)
7576
if (NOT ${_is_imported})
7677
_target_link_libraries(${target} PRIVATE $<$<LINK_LANGUAGE:CXX>:wasi-itk-extras>)
77-
set_property(TARGET ${wasm_target} APPEND PROPERTY COMPILE_OPTIONS -flto -msimd128 -D_WASI_EMULATED_PROCESS_CLOCKS -D_WASI_EMULATED_SIGNAL)
78+
set_property(TARGET ${wasm_target} APPEND PROPERTY COMPILE_OPTIONS -D_WASI_EMULATED_PROCESS_CLOCKS -D_WASI_EMULATED_SIGNAL)
7879
target_compile_options(${wasm_target} PRIVATE $<$<CONFIG:Debug>:-fno-lto -g>)
7980
get_property(_link_flags TARGET ${wasm_target} PROPERTY LINK_FLAGS)
8081
set_property(TARGET ${wasm_target} PROPERTY LINK_FLAGS

0 commit comments

Comments
 (0)