changeset 755:4a3b96630e6c

Merge from default
author Benjamin Golinvaux <bgo@osimis.io>
date Wed, 22 May 2019 16:17:32 +0200
parents 92c400a09f1b (current diff) f3a7092ed10e (diff)
children 46403ab629f6
files Resources/CMake/OrthancStoneConfiguration.cmake
diffstat 1 files changed, 16 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/Resources/CMake/OrthancStoneConfiguration.cmake	Wed May 22 16:13:46 2019 +0200
+++ b/Resources/CMake/OrthancStoneConfiguration.cmake	Wed May 22 16:17:32 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
@@ -434,7 +447,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