comparison OrthancStone/Resources/CMake/OrthancStoneWebAssemblyConfiguration.cmake @ 1901:184b0aeae1af

fix build of sdl
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 29 Jan 2022 16:55:14 +0100
parents OrthancStone/Sources/Platforms/WebAssembly/OrthancStoneWebAssemblyConfiguration.cmake@563f6aa8e24c
children 07964689cb0b
comparison
equal deleted inserted replaced
1900:563f6aa8e24c 1901:184b0aeae1af
1 # Stone of Orthanc
2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
3 # Department, University Hospital of Liege, Belgium
4 # Copyright (C) 2017-2022 Osimis S.A., Belgium
5 # Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
6 #
7 # This program is free software: you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public License
9 # as published by the Free Software Foundation, either version 3 of
10 # the License, or (at your option) any later version.
11 #
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
16 #
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this program. If not, see
19 # <http://www.gnu.org/licenses/>.
20
21
22
23
24 #####################################################################
25 ## Sanity check of the configuration
26 #####################################################################
27
28 set(ENABLE_WEB_CLIENT OFF)
29 include(${CMAKE_CURRENT_LIST_DIR}/OrthancStoneConfiguration.cmake)
30
31 if (NOT ORTHANC_SANDBOXED)
32 message(FATAL_ERROR "WebAssembly target must me configured as sandboxed")
33 endif()
34
35 if (NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
36 message(FATAL_ERROR "WebAssembly target requires the emscripten compiler")
37 endif()
38
39 add_definitions(
40 -DORTHANC_ENABLE_SDL=0
41 -DORTHANC_ENABLE_WASM=1
42 )
43
44
45 #####################################################################
46 ## Additional source files for WebAssembly
47 #####################################################################
48
49 list(APPEND ORTHANC_STONE_SOURCES
50 ${CMAKE_CURRENT_LIST_DIR}/../../Sources/Platforms/WebAssembly/WebAssemblyCairoViewport.cpp
51 ${CMAKE_CURRENT_LIST_DIR}/../../Sources/Platforms/WebAssembly/WebAssemblyLoadersContext.cpp
52 ${CMAKE_CURRENT_LIST_DIR}/../../Sources/Platforms/WebAssembly/WebAssemblyOracle.cpp
53 ${CMAKE_CURRENT_LIST_DIR}/../../Sources/Platforms/WebAssembly/WebAssemblyViewport.cpp
54 )
55
56 if (ENABLE_OPENGL)
57 list(APPEND ORTHANC_STONE_SOURCES
58 ${CMAKE_CURRENT_LIST_DIR}/../../Sources/Platforms/WebAssembly/WebAssemblyOpenGLContext.cpp
59 ${CMAKE_CURRENT_LIST_DIR}/../../Sources/Platforms/WebAssembly/WebGLViewport.cpp
60 ${CMAKE_CURRENT_LIST_DIR}/../../Sources/Platforms/WebAssembly/WebGLViewportsRegistry.cpp
61 )
62 endif()