Mercurial > hg > orthanc-stone
changeset 2081:3ef91da06636
fix compatibility with Emscripten 3.1.47
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 11 Oct 2023 16:38:38 +0200 |
parents | 3ca565841402 |
children | a6d5373e471c 0c0c228a3a73 |
files | Applications/Samples/Common/RtViewerApp.h Applications/Samples/Common/RtViewerView.h Applications/Samples/RtViewerPlugin/CMakeLists.txt Applications/Samples/WebAssembly/CMakeLists.txt Applications/StoneWebViewer/NEWS Applications/StoneWebViewer/Plugin/CMakeLists.txt Applications/StoneWebViewer/WebAssembly/CMakeLists.txt Applications/StoneWebViewer/WebAssembly/StoneModule/CMakeLists.txt OrthancStone/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake OrthancStone/Resources/WebAssemblyUnitTests/CMakeLists.txt RenderingPlugin/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp |
diffstat | 11 files changed, 52 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/Applications/Samples/Common/RtViewerApp.h Mon Aug 14 10:36:35 2023 +0200 +++ b/Applications/Samples/Common/RtViewerApp.h Wed Oct 11 16:38:38 2023 +0200 @@ -36,7 +36,6 @@ #include "../../../OrthancStone/Sources/Volumes/DicomVolumeImage.h" #include <boost/enable_shared_from_this.hpp> -#include <boost/thread.hpp> #include <boost/noncopyable.hpp> #if ORTHANC_ENABLE_SDL
--- a/Applications/Samples/Common/RtViewerView.h Mon Aug 14 10:36:35 2023 +0200 +++ b/Applications/Samples/Common/RtViewerView.h Wed Oct 11 16:38:38 2023 +0200 @@ -36,7 +36,6 @@ #include "../../../OrthancStone/Sources/Volumes/VolumeSceneLayerSource.h" #include <boost/enable_shared_from_this.hpp> -#include <boost/thread.hpp> #include <boost/noncopyable.hpp> namespace OrthancStone
--- a/Applications/Samples/RtViewerPlugin/CMakeLists.txt Mon Aug 14 10:36:35 2023 +0200 +++ b/Applications/Samples/RtViewerPlugin/CMakeLists.txt Wed Oct 11 16:38:38 2023 +0200 @@ -119,6 +119,8 @@ ${ORTHANC_CORE_SOURCES} ) +DefineSourceBasenameForTarget(RtViewerPlugin) + set_target_properties(RtViewerPlugin PROPERTIES VERSION ${ORTHANC_PLUGIN_VERSION} SOVERSION ${ORTHANC_PLUGIN_VERSION})
--- a/Applications/Samples/WebAssembly/CMakeLists.txt Mon Aug 14 10:36:35 2023 +0200 +++ b/Applications/Samples/WebAssembly/CMakeLists.txt Wed Oct 11 16:38:38 2023 +0200 @@ -45,7 +45,7 @@ set(WASM_FLAGS "${WASM_FLAGS} -s SAFE_HEAP=1") endif() -set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s EXTRA_EXPORTED_RUNTIME_METHODS='[\"ccall\", \"cwrap\"]'") +set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s EXPORTED_RUNTIME_METHODS='[\"ccall\", \"cwrap\"]'") set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s ERROR_ON_UNDEFINED_SYMBOLS=1") set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s ALLOW_MEMORY_GROWTH=1 -s TOTAL_MEMORY=268435456") # 256MB + resize set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1") @@ -63,6 +63,7 @@ SET(ENABLE_DCMTK OFF) # Not necessary SET(ENABLE_GOOGLE_TEST OFF) SET(ENABLE_LOCALE ON) # Necessary for text rendering +SET(ENABLE_MODULE_JOBS OFF) SET(ORTHANC_SANDBOXED ON) # this will set up the build system for Stone of Orthanc and will @@ -88,6 +89,9 @@ ${AUTOGENERATED_SOURCES} ) +DefineSourceBasenameForTarget(OrthancStone) + + ################################################################################ # Define the WASM module @@ -103,6 +107,8 @@ ../Common/RtViewerView.h ) +DefineSourceBasenameForTarget(RtViewerWasm) + set_target_properties(RtViewerWasm PROPERTIES COMPILE_FLAGS "${WASM_FLAGS}" @@ -143,6 +149,8 @@ SingleFrameViewer/SingleFrameViewer.cpp ) +DefineSourceBasenameForTarget(SingleFrameViewerWasm) + set_target_properties(SingleFrameViewerWasm PROPERTIES COMPILE_FLAGS "${WASM_FLAGS}" @@ -171,3 +179,10 @@ ${CMAKE_CURRENT_BINARY_DIR}/SingleFrameViewerWasm.wasm DESTINATION ${ORTHANC_STONE_INSTALL_PREFIX}/SingleFrameViewer/ ) + + +# Boost::Math begs for -std=c++14 since Boost 1.82.0 +set_property(TARGET OrthancStone PROPERTY CXX_STANDARD 14) +set_property(TARGET RtViewerWasm PROPERTY CXX_STANDARD 14) +set_property(TARGET SingleFrameViewerWasm PROPERTY CXX_STANDARD 14) +
--- a/Applications/StoneWebViewer/NEWS Mon Aug 14 10:36:35 2023 +0200 +++ b/Applications/StoneWebViewer/NEWS Wed Oct 11 16:38:38 2023 +0200 @@ -7,7 +7,8 @@ ----------- * Prevent dragging series before they are ready -* Open the first loaded series only if it is part of a selected study. +* Open the first loaded series only if it is part of a selected study +* Fix compatibility with Emscripten 3.1.47 Version 2.5 (2022-12-05)
--- a/Applications/StoneWebViewer/Plugin/CMakeLists.txt Mon Aug 14 10:36:35 2023 +0200 +++ b/Applications/StoneWebViewer/Plugin/CMakeLists.txt Wed Oct 11 16:38:38 2023 +0200 @@ -132,6 +132,8 @@ ${ORTHANC_CORE_SOURCES} ) +DefineSourceBasenameForTarget(StoneWebViewer) + set_target_properties(StoneWebViewer PROPERTIES VERSION ${STONE_WEB_VIEWER_VERSION} SOVERSION ${STONE_WEB_VIEWER_VERSION})
--- a/Applications/StoneWebViewer/WebAssembly/CMakeLists.txt Mon Aug 14 10:36:35 2023 +0200 +++ b/Applications/StoneWebViewer/WebAssembly/CMakeLists.txt Wed Oct 11 16:38:38 2023 +0200 @@ -36,7 +36,7 @@ set(WASM_FLAGS "${WASM_FLAGS} -s SAFE_HEAP=1") endif() -set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s EXTRA_EXPORTED_RUNTIME_METHODS='[\"ccall\", \"cwrap\"]'") +set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s EXPORTED_RUNTIME_METHODS='[\"ccall\", \"cwrap\"]'") set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s ERROR_ON_UNDEFINED_SYMBOLS=1") set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s ALLOW_MEMORY_GROWTH=1 -s TOTAL_MEMORY=268435456") # 256MB + resize set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1") @@ -56,6 +56,7 @@ SET(ENABLE_DCMTK_TRANSCODING OFF) SET(ENABLE_GOOGLE_TEST OFF) SET(ENABLE_LOCALE ON) # Necessary for text rendering +SET(ENABLE_MODULE_JOBS OFF) SET(ENABLE_PUGIXML ON) # Necessary for OsiriX annotations SET(ORTHANC_SANDBOXED ON) @@ -93,7 +94,7 @@ # Create the wrapper to call C++ from JavaScript # --------------------------------------------------------------- -set(LIBCLANG "libclang-4.0.so.1" CACHE PATH "Version of clang to generate the code model") +set(LIBCLANG "libclang.so.1" CACHE PATH "Version of clang to generate the code model") set(STONE_WRAPPER ${CMAKE_CURRENT_BINARY_DIR}/stone.js) include(FindPython3 OPTIONAL RESULT_VARIABLE HAS_CMAKE_PYTHON3) @@ -134,6 +135,9 @@ StoneWebViewer.cpp ) +# Boost::Math begs for -std=c++14 since Boost 1.82.0 +set_property(TARGET StoneWebViewer PROPERTY CXX_STANDARD 14) + DefineSourceBasenameForTarget(StoneWebViewer) set_target_properties(StoneWebViewer
--- a/Applications/StoneWebViewer/WebAssembly/StoneModule/CMakeLists.txt Mon Aug 14 10:36:35 2023 +0200 +++ b/Applications/StoneWebViewer/WebAssembly/StoneModule/CMakeLists.txt Wed Oct 11 16:38:38 2023 +0200 @@ -46,7 +46,7 @@ set(WASM_FLAGS "${WASM_FLAGS} -s SAFE_HEAP=1") endif() -set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s EXTRA_EXPORTED_RUNTIME_METHODS='[\"ccall\", \"cwrap\"]'") +set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s EXPORTED_RUNTIME_METHODS='[\"ccall\", \"cwrap\"]'") set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s ERROR_ON_UNDEFINED_SYMBOLS=1") set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s ASSERTIONS=1 -s DISABLE_EXCEPTION_CATCHING=0") set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s ALLOW_MEMORY_GROWTH=1 -s TOTAL_MEMORY=268435456") # 256MB + resize @@ -121,6 +121,9 @@ LINK_FLAGS "${WASM_LINKER_FLAGS}" ) +# Boost::Math begs for -std=c++14 since Boost 1.82.0 +set_property(TARGET StoneWebViewer PROPERTY CXX_STANDARD 14) + # Make sure to have the wrapper generated add_dependencies(StoneWebViewer StoneWrapper)
--- a/OrthancStone/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake Mon Aug 14 10:36:35 2023 +0200 +++ b/OrthancStone/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake Wed Oct 11 16:38:38 2023 +0200 @@ -181,6 +181,9 @@ elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "b2e08d83e21d") # WSI 1.1 (framework pre-1.10.0), to remove "-std=c++11" set(ORTHANC_FRAMEWORK_MD5 "2eaa073cbb4b44ffba199ad93393b2b1") + elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "daf4807631c5") + # DICOMweb 1.15 (framework pre-1.12.2) + set(ORTHANC_FRAMEWORK_MD5 "c644aff2817306b3207c98c92e43f35f") endif() endif() endif()
--- a/OrthancStone/Resources/WebAssemblyUnitTests/CMakeLists.txt Mon Aug 14 10:36:35 2023 +0200 +++ b/OrthancStone/Resources/WebAssemblyUnitTests/CMakeLists.txt Wed Oct 11 16:38:38 2023 +0200 @@ -39,7 +39,7 @@ set(WASM_FLAGS "${WASM_FLAGS} -s SAFE_HEAP=1") endif() -set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s EXTRA_EXPORTED_RUNTIME_METHODS='[\"ccall\", \"cwrap\"]'") +set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s EXPORTED_RUNTIME_METHODS='[\"ccall\", \"cwrap\"]'") set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s ERROR_ON_UNDEFINED_SYMBOLS=1") set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s ALLOW_MEMORY_GROWTH=1 -s TOTAL_MEMORY=268435456") # 256MB + resize set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1") @@ -55,11 +55,12 @@ include(${CMAKE_SOURCE_DIR}/../CMake/OrthancStoneWebAssemblyParameters.cmake) -SET(ENABLE_DCMTK ON) # Necessary for the tests of the Orthanc framework -SET(ENABLE_PUGIXML ON) # Necessary for the tests of the Orthanc framework +SET(ENABLE_DCMTK ON) # Necessary for the tests of the Orthanc framework SET(ENABLE_GOOGLE_TEST OFF) SET(ENABLE_LOCALE ON) # Necessary for text rendering -SET(ENABLE_LUA ON) # Necessary for the tests of the Orthanc framework +SET(ENABLE_LUA ON) # Necessary for the tests of the Orthanc framework +SET(ENABLE_MODULE_JOBS OFF) +SET(ENABLE_PUGIXML ON) # Necessary for the tests of the Orthanc framework SET(ORTHANC_SANDBOXED ON) # this will set up the build system for Stone of Orthanc and will @@ -118,6 +119,9 @@ ${ORTHANC_STONE_SOURCES} ) +# Boost::Math begs for -std=c++14 since Boost 1.82.0 +set_property(TARGET UnitTests PROPERTY CXX_STANDARD 14) + DefineSourceBasenameForTarget(UnitTests)
--- a/RenderingPlugin/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp Mon Aug 14 10:36:35 2023 +0200 +++ b/RenderingPlugin/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp Wed Oct 11 16:38:38 2023 +0200 @@ -1670,15 +1670,16 @@ return true; } +#ifdef _MSC_VER +#define ORTHANC_SCANF sscanf_s +#else +#define ORTHANC_SCANF sscanf +#endif + // Parse the version - int aa, bb, cc; - if ( -#ifdef _MSC_VER - sscanf_s -#else - sscanf -#endif - (version, "%4d.%4d.%4d", &aa, &bb, &cc) != 3 || + int aa, bb, cc = 0; + if ((ORTHANC_SCANF(version, "%4d.%4d.%4d", &aa, &bb, &cc) != 3 && + ORTHANC_SCANF(version, "%4d.%4d", &aa, &bb) != 2) || aa < 0 || bb < 0 || cc < 0)