3 # This script builds dali-adaptor using Emscripten.
5 # DESKTOP_PREFIX is required to build Emscripten DALi.
6 if [ -z ${DESKTOP_PREFIX} ]; then
7 echo "DESKTOP_PREFIX is required to build adaptor against dali-core. Please make sure you have sourced your setenv script (created by dali_env)."
16 /usr/bin/cmake .. -DCMAKE_BUILD_TYPE=Debug -DEMSCRIPTEN=1
19 # On error, exit and return error.
20 if [ $? -ne 0 ] ; then
26 mv dali-emscripten dali-emscripten.bc
28 # Non-optimised build.
29 emcc dali-emscripten.bc -o dali-emscripten.html --memory-init-file 0 -s FULL_ES2=1 -s STB_IMAGE=1 -s ALLOW_MEMORY_GROWTH=1 -s ASSERTIONS=1 -s DEMANGLE_SUPPORT=1 -s DISABLE_EXCEPTION_CATCHING=0 -s EXPORT_NAME=\"dali\" -g4 --bind ; make -j8
30 # On error, exit and return error.
31 if [ $? -ne 0 ] ; then
37 #emcc dali-emscripten.bc -o dali-emscripten.html --memory-init-file 0 -s FULL_ES2=1 -s STB_IMAGE=1 -s ALLOW_MEMORY_GROWTH=1 -s ASSERTIONS=2 -s DEMANGLE_SUPPORT=1 -s DISABLE_EXCEPTION_CATCHING=0 -s EXPORT_NAME=\"dali\" --js-opts 0 -g4 --bind
40 #emcc dali-emscripten.bc -o dali-emscripten.html -s FULL_ES2=1 -s STB_IMAGE=1 -s ALLOW_MEMORY_GROWTH=1 -s ASSERTIONS=0 -s DISABLE_EXCEPTION_CATCHING=2 -s EXPORT_NAME=\"dali\" -O2 --bind
42 # Copy the required built artifacts to dali-env.
43 mv ./dali-emscripten.js ${DESKTOP_PREFIX}/share/emscripten/
44 mv ./dali-emscripten.html ${DESKTOP_PREFIX}/share/emscripten/
46 # If static memory initialisation code was created in a separate file, copy this too.
47 if [ -a ./dali-emcripten.html.mem ]; then
48 mv ./dali-emscripten.html.mem ${DESKTOP_PREFIX}/share/emscripten/