# HG changeset patch # User Sebastien Jodogne # Date 1558534524 -7200 # Node ID f3a7092ed10e20a51ba997f47795ed496cbbf712 # Parent ab236bb5dbc7ee9ea120c2cc4785bfc12080cd22 fix wasm build diff -r ab236bb5dbc7 -r f3a7092ed10e Resources/CMake/OrthancStoneConfiguration.cmake --- a/Resources/CMake/OrthancStoneConfiguration.cmake Wed May 22 14:46:26 2019 +0200 +++ b/Resources/CMake/OrthancStoneConfiguration.cmake Wed May 22 16:15:24 2019 +0200 @@ -65,6 +65,7 @@ message(FATAL_ERROR "WebAssembly target requires the emscripten compiler") endif() + set(ENABLE_THREADS OFF) add_definitions(-DORTHANC_ENABLE_WASM=1) else() if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten" OR @@ -74,6 +75,7 @@ message(FATAL_ERROR "Trying to use a Web compiler for a native build") endif() + set(ENABLE_THREADS ON) add_definitions(-DORTHANC_ENABLE_WASM=0) endif() @@ -109,7 +111,6 @@ message("SDL is enabled") include(${CMAKE_CURRENT_LIST_DIR}/SdlConfiguration.cmake) add_definitions( - -DORTHANC_ENABLE_THREADS=1 -DORTHANC_ENABLE_QT=0 -DORTHANC_ENABLE_SDL=1 ) @@ -117,7 +118,6 @@ message("QT is enabled") include(${CMAKE_CURRENT_LIST_DIR}/QtConfiguration.cmake) add_definitions( - -DORTHANC_ENABLE_THREADS=1 -DORTHANC_ENABLE_QT=1 -DORTHANC_ENABLE_SDL=0 ) @@ -127,11 +127,17 @@ add_definitions( -DORTHANC_ENABLE_SDL=0 -DORTHANC_ENABLE_QT=0 - -DORTHANC_ENABLE_THREADS=0 ) endif() +if (ENABLE_THREADS) + add_definitions(-DORTHANC_ENABLE_THREADS=1) +else() + add_definitions(-DORTHANC_ENABLE_THREADS=0) +endif() + + if (ENABLE_OPENGL AND CMAKE_SYSTEM_NAME STREQUAL "Windows") include(${CMAKE_CURRENT_LIST_DIR}/GlewConfiguration.cmake) add_definitions( @@ -356,6 +362,13 @@ endif() +if (ENABLE_THREADS) + list(APPEND ORTHANC_STONE_SOURCES + ${ORTHANC_STONE_ROOT}/Framework/Oracle/ThreadedOracle.cpp + ) +endif() + + list(APPEND ORTHANC_STONE_SOURCES #${ORTHANC_STONE_ROOT}/Framework/Layers/SeriesFrameRendererFactory.cpp #${ORTHANC_STONE_ROOT}/Framework/Layers/SingleFrameRendererFactory.cpp @@ -433,7 +446,6 @@ ${ORTHANC_STONE_ROOT}/Framework/Oracle/GetOrthancWebViewerJpegCommand.cpp ${ORTHANC_STONE_ROOT}/Framework/Oracle/OracleCommandWithPayload.cpp ${ORTHANC_STONE_ROOT}/Framework/Oracle/OrthancRestApiCommand.cpp - ${ORTHANC_STONE_ROOT}/Framework/Oracle/ThreadedOracle.cpp ${ORTHANC_STONE_ROOT}/Framework/Radiography/RadiographyAlphaLayer.cpp ${ORTHANC_STONE_ROOT}/Framework/Radiography/RadiographyDicomLayer.cpp ${ORTHANC_STONE_ROOT}/Framework/Radiography/RadiographyLayer.cpp