Mercurial > hg > orthanc-stone
diff Resources/CodeGeneration/testWasmIntegrated/build.sh @ 495:6405435480ae bgo-commands-codegen
Fixed template to add dump capabilities + started work on an integrated TS/WASM test
author | bgo-osimis |
---|---|
date | Sat, 23 Feb 2019 14:14:32 +0100 |
parents | |
children | 8b6ceae45ba0 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Resources/CodeGeneration/testWasmIntegrated/build.sh Sat Feb 23 14:14:32 2019 +0100 @@ -0,0 +1,33 @@ +#!/bin/bash + +set -e + +mkdir -p build-wasm +cd build-wasm + +# shellcheck source="$HOME/apps/emsdk/emsdk_env.sh" +source "$HOME/apps/emsdk/emsdk_env.sh" +cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE=${EMSCRIPTEN}/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_WASM=ON .. + +ninja + +echo + +cd .. + +mkdir -p + +# compile TS to JS +tsc --module commonjs --sourceMap -t ES2015 --outDir "build-tsc/" build-wasm/testWasmIntegratedCpp_generated.ts testWasmIntegrated.ts + +# bundle all JS files to final build dir +browserify "build-wasm/testWasmIntegratedCpp.js" "build-tsc/testWasmIntegratedCpp_generated.js" "build-tsc/testWasmIntegrated.js" -o "testWasmIntegratedApp.js" + +# copy HTML start page to output dir +cp index.html build-final/ + +# copy WASM binary to output dir +cp build-wasm/testWasmIntegratedCpp.wasm build-final/ + + +