Mercurial > hg > orthanc-stone
comparison Applications/Samples/build-wasm-samples.sh @ 1538:d1806b4e4839
moving OrthancStone/Samples/ as Applications/Samples/
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 11 Aug 2020 13:24:38 +0200 |
parents | OrthancStone/Samples/build-wasm-samples.sh@244ad1e4e76a |
children | 8c5f9864545f |
comparison
equal
deleted
inserted
replaced
1537:de8cf5859e84 | 1538:d1806b4e4839 |
---|---|
1 #!/bin/bash | |
2 # | |
3 # usage: | |
4 # to build the samples in RelWithDebInfo: | |
5 # ./build-wasm-samples.sh | |
6 # | |
7 # to build the samples in Release: | |
8 # ./build-wasm-samples.sh Release | |
9 | |
10 set -e | |
11 | |
12 if [ ! -d "WebAssembly" ]; then | |
13 echo "This script must be run from the Samples folder one level below orthanc-stone" | |
14 exit 1 | |
15 fi | |
16 | |
17 | |
18 currentDir=$(pwd) | |
19 samplesRootDir=$(pwd) | |
20 devrootDir=$(pwd)/../../ | |
21 | |
22 buildType=${1:-RelWithDebInfo} | |
23 buildFolderName="$devrootDir/out/build-stone-wasm-samples-$buildType" | |
24 installFolderName="$devrootDir/out/install-stone-wasm-samples-$buildType" | |
25 | |
26 mkdir -p $buildFolderName | |
27 # change current folder to the build folder | |
28 pushd $buildFolderName | |
29 | |
30 # configure the environment to use Emscripten | |
31 source ~/apps/emsdk/emsdk_env.sh | |
32 | |
33 emcmake cmake -G "Ninja" \ | |
34 -DCMAKE_BUILD_TYPE=$buildType \ | |
35 -DCMAKE_INSTALL_PREFIX=$installFolderName \ | |
36 -DSTATIC_BUILD=ON -DALLOW_DOWNLOADS=ON \ | |
37 $samplesRootDir/WebAssembly | |
38 | |
39 # perform build + installation | |
40 ninja | |
41 ninja install | |
42 | |
43 # restore the original working folder | |
44 popd | |
45 | |
46 echo "If all went well, the output files can be found in $installFolderName:" | |
47 | |
48 ls $installFolderName |