comparison Resources/CMake/OrthancStoneConfiguration.cmake @ 749:f3a7092ed10e

fix wasm build
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 22 May 2019 16:15:24 +0200
parents ab236bb5dbc7
children 4a3b96630e6c
comparison
equal deleted inserted replaced
748:ab236bb5dbc7 749:f3a7092ed10e
63 63
64 if (NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten") 64 if (NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
65 message(FATAL_ERROR "WebAssembly target requires the emscripten compiler") 65 message(FATAL_ERROR "WebAssembly target requires the emscripten compiler")
66 endif() 66 endif()
67 67
68 set(ENABLE_THREADS OFF)
68 add_definitions(-DORTHANC_ENABLE_WASM=1) 69 add_definitions(-DORTHANC_ENABLE_WASM=1)
69 else() 70 else()
70 if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten" OR 71 if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten" OR
71 CMAKE_SYSTEM_NAME STREQUAL "PNaCl" OR 72 CMAKE_SYSTEM_NAME STREQUAL "PNaCl" OR
72 CMAKE_SYSTEM_NAME STREQUAL "NaCl32" OR 73 CMAKE_SYSTEM_NAME STREQUAL "NaCl32" OR
73 CMAKE_SYSTEM_NAME STREQUAL "NaCl64") 74 CMAKE_SYSTEM_NAME STREQUAL "NaCl64")
74 message(FATAL_ERROR "Trying to use a Web compiler for a native build") 75 message(FATAL_ERROR "Trying to use a Web compiler for a native build")
75 endif() 76 endif()
76 77
78 set(ENABLE_THREADS ON)
77 add_definitions(-DORTHANC_ENABLE_WASM=0) 79 add_definitions(-DORTHANC_ENABLE_WASM=0)
78 endif() 80 endif()
79 81
80 82
81 ##################################################################### 83 #####################################################################
107 message("SDL and QT may not be defined together") 109 message("SDL and QT may not be defined together")
108 elseif(ENABLE_SDL) 110 elseif(ENABLE_SDL)
109 message("SDL is enabled") 111 message("SDL is enabled")
110 include(${CMAKE_CURRENT_LIST_DIR}/SdlConfiguration.cmake) 112 include(${CMAKE_CURRENT_LIST_DIR}/SdlConfiguration.cmake)
111 add_definitions( 113 add_definitions(
112 -DORTHANC_ENABLE_THREADS=1
113 -DORTHANC_ENABLE_QT=0 114 -DORTHANC_ENABLE_QT=0
114 -DORTHANC_ENABLE_SDL=1 115 -DORTHANC_ENABLE_SDL=1
115 ) 116 )
116 elseif(ENABLE_QT) 117 elseif(ENABLE_QT)
117 message("QT is enabled") 118 message("QT is enabled")
118 include(${CMAKE_CURRENT_LIST_DIR}/QtConfiguration.cmake) 119 include(${CMAKE_CURRENT_LIST_DIR}/QtConfiguration.cmake)
119 add_definitions( 120 add_definitions(
120 -DORTHANC_ENABLE_THREADS=1
121 -DORTHANC_ENABLE_QT=1 121 -DORTHANC_ENABLE_QT=1
122 -DORTHANC_ENABLE_SDL=0 122 -DORTHANC_ENABLE_SDL=0
123 ) 123 )
124 else() 124 else()
125 message("SDL and QT are both disabled") 125 message("SDL and QT are both disabled")
126 unset(USE_SYSTEM_SDL CACHE) 126 unset(USE_SYSTEM_SDL CACHE)
127 add_definitions( 127 add_definitions(
128 -DORTHANC_ENABLE_SDL=0 128 -DORTHANC_ENABLE_SDL=0
129 -DORTHANC_ENABLE_QT=0 129 -DORTHANC_ENABLE_QT=0
130 -DORTHANC_ENABLE_THREADS=0 130 )
131 ) 131 endif()
132
133
134 if (ENABLE_THREADS)
135 add_definitions(-DORTHANC_ENABLE_THREADS=1)
136 else()
137 add_definitions(-DORTHANC_ENABLE_THREADS=0)
132 endif() 138 endif()
133 139
134 140
135 if (ENABLE_OPENGL AND CMAKE_SYSTEM_NAME STREQUAL "Windows") 141 if (ENABLE_OPENGL AND CMAKE_SYSTEM_NAME STREQUAL "Windows")
136 include(${CMAKE_CURRENT_LIST_DIR}/GlewConfiguration.cmake) 142 include(${CMAKE_CURRENT_LIST_DIR}/GlewConfiguration.cmake)
354 ${ORTHANC_STONE_ROOT}/Framework/Deprecated/dev.h 360 ${ORTHANC_STONE_ROOT}/Framework/Deprecated/dev.h
355 ) 361 )
356 endif() 362 endif()
357 363
358 364
365 if (ENABLE_THREADS)
366 list(APPEND ORTHANC_STONE_SOURCES
367 ${ORTHANC_STONE_ROOT}/Framework/Oracle/ThreadedOracle.cpp
368 )
369 endif()
370
371
359 list(APPEND ORTHANC_STONE_SOURCES 372 list(APPEND ORTHANC_STONE_SOURCES
360 #${ORTHANC_STONE_ROOT}/Framework/Layers/SeriesFrameRendererFactory.cpp 373 #${ORTHANC_STONE_ROOT}/Framework/Layers/SeriesFrameRendererFactory.cpp
361 #${ORTHANC_STONE_ROOT}/Framework/Layers/SingleFrameRendererFactory.cpp 374 #${ORTHANC_STONE_ROOT}/Framework/Layers/SingleFrameRendererFactory.cpp
362 375
363 ${ORTHANC_STONE_ROOT}/Framework/Scene2D/CairoCompositor.cpp 376 ${ORTHANC_STONE_ROOT}/Framework/Scene2D/CairoCompositor.cpp
431 ${ORTHANC_STONE_ROOT}/Framework/Messages/Promise.h 444 ${ORTHANC_STONE_ROOT}/Framework/Messages/Promise.h
432 ${ORTHANC_STONE_ROOT}/Framework/Oracle/GetOrthancImageCommand.cpp 445 ${ORTHANC_STONE_ROOT}/Framework/Oracle/GetOrthancImageCommand.cpp
433 ${ORTHANC_STONE_ROOT}/Framework/Oracle/GetOrthancWebViewerJpegCommand.cpp 446 ${ORTHANC_STONE_ROOT}/Framework/Oracle/GetOrthancWebViewerJpegCommand.cpp
434 ${ORTHANC_STONE_ROOT}/Framework/Oracle/OracleCommandWithPayload.cpp 447 ${ORTHANC_STONE_ROOT}/Framework/Oracle/OracleCommandWithPayload.cpp
435 ${ORTHANC_STONE_ROOT}/Framework/Oracle/OrthancRestApiCommand.cpp 448 ${ORTHANC_STONE_ROOT}/Framework/Oracle/OrthancRestApiCommand.cpp
436 ${ORTHANC_STONE_ROOT}/Framework/Oracle/ThreadedOracle.cpp
437 ${ORTHANC_STONE_ROOT}/Framework/Radiography/RadiographyAlphaLayer.cpp 449 ${ORTHANC_STONE_ROOT}/Framework/Radiography/RadiographyAlphaLayer.cpp
438 ${ORTHANC_STONE_ROOT}/Framework/Radiography/RadiographyDicomLayer.cpp 450 ${ORTHANC_STONE_ROOT}/Framework/Radiography/RadiographyDicomLayer.cpp
439 ${ORTHANC_STONE_ROOT}/Framework/Radiography/RadiographyLayer.cpp 451 ${ORTHANC_STONE_ROOT}/Framework/Radiography/RadiographyLayer.cpp
440 ${ORTHANC_STONE_ROOT}/Framework/Radiography/RadiographyLayerCropTracker.cpp 452 ${ORTHANC_STONE_ROOT}/Framework/Radiography/RadiographyLayerCropTracker.cpp
441 ${ORTHANC_STONE_ROOT}/Framework/Radiography/RadiographyLayerMaskTracker.cpp 453 ${ORTHANC_STONE_ROOT}/Framework/Radiography/RadiographyLayerMaskTracker.cpp