comparison Resources/CMake/OrthancStoneConfiguration.cmake @ 616:97926984d5d0

WebAssembly sample using Scene2D
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 02 May 2019 13:27:41 +0200
parents 412a2d01a189
children 419e5662d7a5 8b6adfb62a2f
comparison
equal deleted inserted replaced
615:b4de8272e8fb 616:97926984d5d0
53 endif() 53 endif()
54 54
55 if (ENABLE_SSL) 55 if (ENABLE_SSL)
56 message(FATAL_ERROR "Cannot enable SSL in sandboxed environments") 56 message(FATAL_ERROR "Cannot enable SSL in sandboxed environments")
57 endif() 57 endif()
58 endif()
59
60 if (ENABLE_WASM)
61 if (NOT ORTHANC_SANDBOXED)
62 message(FATAL_ERROR "WebAssembly target must me configured as sandboxed")
63 endif()
64
65 if (NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
66 message(FATAL_ERROR "WebAssembly target requires the emscripten compiler")
67 endif()
68
69 add_definitions(-DORTHANC_ENABLE_WASM=1)
70 else()
71 if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten" OR
72 CMAKE_SYSTEM_NAME STREQUAL "PNaCl" OR
73 CMAKE_SYSTEM_NAME STREQUAL "NaCl32" OR
74 CMAKE_SYSTEM_NAME STREQUAL "NaCl64")
75 message(FATAL_ERROR "Trying to use a Web compiler for a native build")
76 endif()
77
78 add_definitions(-DORTHANC_ENABLE_WASM=0)
58 endif() 79 endif()
59 80
60 81
61 ##################################################################### 82 #####################################################################
62 ## Configure mandatory third-party components 83 ## Configure mandatory third-party components
439 ${ORTHANC_STONE_ROOT}/Framework/Scene2D/Internals/OpenGLLinesProgram.cpp 460 ${ORTHANC_STONE_ROOT}/Framework/Scene2D/Internals/OpenGLLinesProgram.cpp
440 ${ORTHANC_STONE_ROOT}/Framework/Scene2D/Internals/OpenGLTextProgram.cpp 461 ${ORTHANC_STONE_ROOT}/Framework/Scene2D/Internals/OpenGLTextProgram.cpp
441 ${ORTHANC_STONE_ROOT}/Framework/Scene2D/Internals/OpenGLTextRenderer.cpp 462 ${ORTHANC_STONE_ROOT}/Framework/Scene2D/Internals/OpenGLTextRenderer.cpp
442 ${ORTHANC_STONE_ROOT}/Framework/Scene2D/Internals/OpenGLTextureProgram.cpp 463 ${ORTHANC_STONE_ROOT}/Framework/Scene2D/Internals/OpenGLTextureProgram.cpp
443 ) 464 )
465
466 if (ENABLE_WASM)
467 list(APPEND ORTHANC_STONE_SOURCES
468 ${ORTHANC_STONE_ROOT}/Framework/OpenGL/WebAssemblyOpenGLContext.cpp
469 )
470 endif()
444 endif() 471 endif()
445 472
446 473
447 include_directories(${ORTHANC_STONE_ROOT}) 474 include_directories(${ORTHANC_STONE_ROOT})
448 475