Revert "[Tizen] Disable shader bin cache in TV profile"
[platform/core/uifw/dali-adaptor.git] / build / emscripten / build.sh
1 #!/bin/bash
2
3 # This script builds dali-adaptor using Emscripten.
4
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)."
8   exit 1
9 fi
10
11
12 mkdir -p build
13 cd build
14 rm CMakeCache.txt
15
16 /usr/bin/cmake .. -DCMAKE_BUILD_TYPE=Debug -DEMSCRIPTEN=1
17
18 make -j8
19 # On error, exit and return error.
20 if [ $? -ne 0 ] ; then
21  exit 1
22 fi
23
24
25
26 mv dali-emscripten dali-emscripten.bc
27
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
32  exit 1
33 fi
34
35
36 # Debug build.
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
38
39 # Optimised build.
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
41
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/
45
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/
49 fi