comparison Samples/WebAssembly/docker-internal.sh @ 1492:4b5ec9ea268e

Building WebAssembly samples using Docker
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 25 Jun 2020 09:13:56 +0200
parents
children c9bdf73a8817
comparison
equal deleted inserted replaced
1491:c5627b8493f3 1492:4b5ec9ea268e
1 #!/bin/bash
2 set -ex
3
4 source /opt/emsdk/emsdk_env.sh
5
6 # Use a folder that is writeable by non-root users for the Emscripten cache
7 export EM_CACHE=/tmp/emscripten-cache
8
9 # Get the Orthanc framework
10 cd /tmp/
11 hg clone https://hg.orthanc-server.com/orthanc/
12
13 # Make a copy of the source code in a writeable folder, because of
14 # "DownloadPackage.cmake" that writes to the "ThirdPartyDownloads"
15 # folder next to the "CMakeLists.txt"
16 cd /source
17 hg archive /tmp/source-writeable
18
19 mkdir /tmp/build
20 cd /tmp/build
21
22 cmake /tmp/source-writeable/Samples/WebAssembly \
23 -DCMAKE_BUILD_TYPE=$1 \
24 -DCMAKE_INSTALL_PREFIX=/target \
25 -DCMAKE_TOOLCHAIN_FILE=${EMSDK}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake \
26 -DORTHANC_FRAMEWORK_ROOT=/tmp/orthanc \
27 -DSTATIC_BUILD=ON \
28 -G Ninja
29
30 ninja -j2 install