changeset 2187:d3ae05435296

notes
author Alain Mazy <am@orthanc.team>
date Wed, 26 Mar 2025 17:18:48 +0100
parents e90ddb89c3ae
children 0c2b681cde94
files Applications/Samples/README.md Applications/StoneWebViewer/WebAssembly/NOTES.txt
diffstat 2 files changed, 37 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Applications/Samples/README.md	Wed Mar 26 17:18:33 2025 +0100
+++ b/Applications/Samples/README.md	Wed Mar 26 17:18:48 2025 +0100
@@ -205,7 +205,7 @@
     -DALLOW_DOWNLOADS=ON `
     -DSTATIC_BUILD=ON `
     -DOPENSSL_NO_CAPIENG=ON `
-    ../orthanc-stone/OrthancStone/Samples/Sdl
+    ../orthanc-stone/Applications/Samples/Sdl
   
   $solutionPath = ls -filter *.sln
   Write-Host "Solution file(s) available at: $solutionPath"
--- a/Applications/StoneWebViewer/WebAssembly/NOTES.txt	Wed Mar 26 17:18:33 2025 +0100
+++ b/Applications/StoneWebViewer/WebAssembly/NOTES.txt	Wed Mar 26 17:18:48 2025 +0100
@@ -21,6 +21,42 @@
 https://github.com/jodogne/OrthancDocker/tree/master/wasm-builder
 
 
+Building WebAssembly using Docker & interactively
+=================================================
+
+
+ROOT_DIR=$(pwd)/../../..
+mkdir -p ${ROOT_DIR}/wasm-binaries
+docker run -it --rm \
+    --dns=8.8.8.8 \
+    --user $(id -u):$(id -g) \
+    -v ${ROOT_DIR}:/source \
+    -v ${ROOT_DIR}/wasm-binaries:/target jodogne/wasm-builder:3.1.49 \
+    bash
+
+# In Docker:
+mkdir /tmp/build
+cd /tmp/build
+source /opt/emsdk/emsdk_env.sh
+
+cmake /source/Applications/StoneWebViewer/WebAssembly \
+      -DCMAKE_BUILD_TYPE=Debug \
+      -DORTHANC_STONE_INSTALL_PREFIX=/target/StoneWebViewer \
+      -DCMAKE_TOOLCHAIN_FILE=${EMSDK}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake \
+      -DSTATIC_BUILD=ON \
+      -DLIBCLANG=/usr/lib/llvm-4.0/lib/libclang-4.0.so \
+      -G Ninja
+
+ninja -j12 install
+
+# each time you modify code, run the ninja command again
+
+# to serve the WASM code, you may use
+    "ServeFolders": {
+        "/stone-webviewer-live" : "/home/alain/o/orthanc-stone/wasm-binaries/StoneWebViewer/"
+    }
+
+
 Native compilation (without Docker)
 ===================================