# HG changeset patch
# User Alain Mazy <alain@mazy.be>
# Date 1549276224 -3600
# Node ID 593b8c3c02fb52053b5f839f2585c6b4e7309afa
# Parent  dc091ca6fd5f31d5698275aaa1d9427d392a5f96
fix build setting + build with ninja

diff -r dc091ca6fd5f -r 593b8c3c02fb Applications/Samples/CMakeLists.txt
--- a/Applications/Samples/CMakeLists.txt	Tue Jan 29 18:16:38 2019 +0100
+++ b/Applications/Samples/CMakeLists.txt	Mon Feb 04 11:30:24 2019 +0100
@@ -21,7 +21,7 @@
 
   set(WASM_FLAGS "-s WASM=1")
   set(WASM_FLAGS "${WASM_FLAGS} -s STRICT=1") # drops support for all deprecated build options
-  set(WASM_FLAGS "${WASM_FLAGS} -s FILESYSTEM=0") # remove File system emulation
+  set(WASM_FLAGS "${WASM_FLAGS} -s FILESYSTEM=1") # if we don't include it, gen_uuid.c fails to build because srand, getpid(), ... are not defined
   set(WASM_FLAGS "${WASM_FLAGS} -s DISABLE_EXCEPTION_CATCHING=0") # actually enable exception catching 
   set(WASM_FLAGS "${WASM_FLAGS} -s ERROR_ON_MISSING_LIBRARIES=1")
 
diff -r dc091ca6fd5f -r 593b8c3c02fb Applications/Samples/build-wasm.sh
--- a/Applications/Samples/build-wasm.sh	Tue Jan 29 18:16:38 2019 +0100
+++ b/Applications/Samples/build-wasm.sh	Mon Feb 04 11:30:24 2019 +0100
@@ -18,8 +18,8 @@
 cd $samplesRootDir/build-wasm
 
 source ~/apps/emsdk/emsdk_env.sh
-cmake -DCMAKE_TOOLCHAIN_FILE=${EMSCRIPTEN}/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_BUILD_TYPE=Release -DSTONE_SOURCES_DIR=$currentDir/../../../orthanc-stone -DORTHANC_FRAMEWORK_SOURCE=path -DORTHANC_FRAMEWORK_ROOT=$currentDir/../../../orthanc -DALLOW_DOWNLOADS=ON .. -DENABLE_WASM=ON
-make -j 5 $target
+cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE=${EMSCRIPTEN}/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_BUILD_TYPE=Release -DSTONE_SOURCES_DIR=$currentDir/../../../orthanc-stone -DORTHANC_FRAMEWORK_SOURCE=path -DORTHANC_FRAMEWORK_ROOT=$currentDir/../../../orthanc -DALLOW_DOWNLOADS=ON .. -DENABLE_WASM=ON
+ninja $target
 
 echo "-- building the web application -- "
 cd $currentDir