-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·37 lines (31 loc) · 885 Bytes
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env bash
set -e
export OPTIMIZE="-Os"
export LDFLAGS="${OPTIMIZE}"
export CFLAGS="${OPTIMIZE}"
export CXXFLAGS="${OPTIMIZE}"
mkdir -p build
echo "============================================="
echo "Compiling wasm bindings"
echo "============================================="
# Compile C/C++ code
emcc \
${OPTIMIZE} \
--bind --memory-init-file 0 --closure 1 -s WASM_OBJECT_FILES=0 --llvm-lto 1 \
-fno-exceptions \
-s STRICT=1 \
-s DISABLE_EXCEPTION_CATCHING=1 \
-s NO_EXIT_RUNTIME=1 \
-s FILESYSTEM=0 \
-s ALLOW_MEMORY_GROWTH=1 \
-s MALLOC=emmalloc \
-s MODULARIZE=1 \
-s EXPORT_ES6=1 \
-s ASSERTIONS=0 \
-o ./build/yoga.js \
-I . \
yoga/*.cpp bindings/*.cc
echo "============================================="
echo "Compiling wasm bindings done"
echo "============================================="
ls -lh build/yoga.js build/yoga.wasm