Mercurial > hg > orthanc-stone
comparison Applications/Samples/WebAssembly/CMakeLists.txt @ 2082:a6d5373e471c deep-learning
integration mainline->deep-learning
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 11 Oct 2023 17:10:45 +0200 |
parents | fdb012c86a75 3ef91da06636 |
children | de049fd88697 |
comparison
equal
deleted
inserted
replaced
2078:fdb012c86a75 | 2082:a6d5373e471c |
---|---|
44 if (CMAKE_BUILD_TYPE STREQUAL "Debug") | 44 if (CMAKE_BUILD_TYPE STREQUAL "Debug") |
45 set(WASM_FLAGS "${WASM_FLAGS} -s SAFE_HEAP=1") | 45 set(WASM_FLAGS "${WASM_FLAGS} -s SAFE_HEAP=1") |
46 endif() | 46 endif() |
47 | 47 |
48 set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s ENVIRONMENT=web") | 48 set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s ENVIRONMENT=web") |
49 set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s EXTRA_EXPORTED_RUNTIME_METHODS='[\"ccall\", \"cwrap\"]'") | 49 set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s EXPORTED_RUNTIME_METHODS='[\"ccall\", \"cwrap\"]'") |
50 set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s ERROR_ON_UNDEFINED_SYMBOLS=1") | 50 set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s ERROR_ON_UNDEFINED_SYMBOLS=1") |
51 set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s ALLOW_MEMORY_GROWTH=1 -s TOTAL_MEMORY=268435456") # 256MB + resize | 51 set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s ALLOW_MEMORY_GROWTH=1 -s TOTAL_MEMORY=268435456") # 256MB + resize |
52 set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1") | 52 set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1") |
53 add_definitions( | 53 add_definitions( |
54 -DDISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1 | 54 -DDISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1 |
64 include(${CMAKE_SOURCE_DIR}/../../../OrthancStone/Resources/CMake/OrthancStoneWebAssemblyParameters.cmake) | 64 include(${CMAKE_SOURCE_DIR}/../../../OrthancStone/Resources/CMake/OrthancStoneWebAssemblyParameters.cmake) |
65 | 65 |
66 SET(ENABLE_DCMTK OFF) # Not necessary | 66 SET(ENABLE_DCMTK OFF) # Not necessary |
67 SET(ENABLE_GOOGLE_TEST OFF) | 67 SET(ENABLE_GOOGLE_TEST OFF) |
68 SET(ENABLE_LOCALE ON) # Necessary for text rendering | 68 SET(ENABLE_LOCALE ON) # Necessary for text rendering |
69 SET(ENABLE_MODULE_JOBS OFF) | |
69 SET(ORTHANC_SANDBOXED ON) | 70 SET(ORTHANC_SANDBOXED ON) |
70 | 71 |
71 # this will set up the build system for Stone of Orthanc and will | 72 # this will set up the build system for Stone of Orthanc and will |
72 # populate the ORTHANC_STONE_SOURCES CMake variable | 73 # populate the ORTHANC_STONE_SOURCES CMake variable |
73 include(${CMAKE_SOURCE_DIR}/../../../OrthancStone/Resources/CMake/OrthancStoneWebAssemblyConfiguration.cmake) | 74 include(${CMAKE_SOURCE_DIR}/../../../OrthancStone/Resources/CMake/OrthancStoneWebAssemblyConfiguration.cmake) |
89 add_library(OrthancStone STATIC | 90 add_library(OrthancStone STATIC |
90 ${ORTHANC_STONE_SOURCES} | 91 ${ORTHANC_STONE_SOURCES} |
91 ${AUTOGENERATED_SOURCES} | 92 ${AUTOGENERATED_SOURCES} |
92 ) | 93 ) |
93 | 94 |
95 DefineSourceBasenameForTarget(OrthancStone) | |
96 | |
97 | |
94 ################################################################################ | 98 ################################################################################ |
95 | 99 |
96 # Define the WASM module | 100 # Define the WASM module |
97 # --------------------------------------------------------------- | 101 # --------------------------------------------------------------- |
98 | 102 |
103 ../Common/RtViewerApp.cpp | 107 ../Common/RtViewerApp.cpp |
104 ../Common/RtViewerApp.h | 108 ../Common/RtViewerApp.h |
105 ../Common/RtViewerView.cpp | 109 ../Common/RtViewerView.cpp |
106 ../Common/RtViewerView.h | 110 ../Common/RtViewerView.h |
107 ) | 111 ) |
112 | |
113 DefineSourceBasenameForTarget(RtViewerWasm) | |
108 | 114 |
109 set_target_properties(RtViewerWasm | 115 set_target_properties(RtViewerWasm |
110 PROPERTIES | 116 PROPERTIES |
111 COMPILE_FLAGS "${WASM_FLAGS}" | 117 COMPILE_FLAGS "${WASM_FLAGS}" |
112 LINK_FLAGS "${WASM_LINKER_FLAGS}" | 118 LINK_FLAGS "${WASM_LINKER_FLAGS}" |
144 | 150 |
145 add_executable(SingleFrameViewerWasm | 151 add_executable(SingleFrameViewerWasm |
146 SingleFrameViewer/SingleFrameViewer.cpp | 152 SingleFrameViewer/SingleFrameViewer.cpp |
147 ) | 153 ) |
148 | 154 |
155 DefineSourceBasenameForTarget(SingleFrameViewerWasm) | |
156 | |
149 set_target_properties(SingleFrameViewerWasm | 157 set_target_properties(SingleFrameViewerWasm |
150 PROPERTIES | 158 PROPERTIES |
151 COMPILE_FLAGS "${WASM_FLAGS}" | 159 COMPILE_FLAGS "${WASM_FLAGS}" |
152 LINK_FLAGS "${WASM_LINKER_FLAGS}" | 160 LINK_FLAGS "${WASM_LINKER_FLAGS}" |
153 ) | 161 ) |
172 ${CMAKE_SOURCE_DIR}/SingleFrameViewer/SingleFrameViewerApp.js | 180 ${CMAKE_SOURCE_DIR}/SingleFrameViewer/SingleFrameViewerApp.js |
173 ${CMAKE_SOURCE_DIR}/SingleFrameViewer/index.html | 181 ${CMAKE_SOURCE_DIR}/SingleFrameViewer/index.html |
174 ${CMAKE_CURRENT_BINARY_DIR}/SingleFrameViewerWasm.wasm | 182 ${CMAKE_CURRENT_BINARY_DIR}/SingleFrameViewerWasm.wasm |
175 DESTINATION ${ORTHANC_STONE_INSTALL_PREFIX}/SingleFrameViewer/ | 183 DESTINATION ${ORTHANC_STONE_INSTALL_PREFIX}/SingleFrameViewer/ |
176 ) | 184 ) |
185 | |
186 | |
187 # Boost::Math begs for -std=c++14 since Boost 1.82.0 | |
188 set_property(TARGET OrthancStone PROPERTY CXX_STANDARD 14) | |
189 set_property(TARGET RtViewerWasm PROPERTY CXX_STANDARD 14) | |
190 set_property(TARGET SingleFrameViewerWasm PROPERTY CXX_STANDARD 14) | |
191 |