-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathbuild.sh
executable file
·50 lines (42 loc) · 987 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
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
set -e
export OPTIMIZE="-O3"
echo "1/2 Compiling pugixml"
cp src/pugiconfig.hpp node_modules/pugixml/src/pugiconfig.hpp
(
emcc \
--bind \
${OPTIMIZE} \
-s WASM=1 \
-s ALLOW_MEMORY_GROWTH=1 \
-s MODULARIZE=1 \
-s ASSERTIONS=0 \
-DNDEBUG \
-s 'EXPORT_NAME="pugixml"' \
-I node_modules/pugixml/src \
-c node_modules/pugixml/src/pugixml.cpp \
-o ./dist/pugixml.o
)
echo "2/2 Compiling camaro wasm bindings"
(
emcc \
--bind \
${OPTIMIZE} \
-s ALLOW_MEMORY_GROWTH=1 \
-s MODULARIZE=1 \
-s ASSERTIONS=0 \
-DNDEBUG \
-s 'MALLOC="emmalloc"' \
-s 'EXPORT_NAME="camaro"' \
-I node_modules/pugixml/src \
-I node_modules/json/single_include/nlohmann \
-o dist/camaro.js \
-Wno-deprecated-register \
-Wno-writable-strings \
--closure 1 \
--llvm-lto 1 \
dist/*.o \
src/camaro.cpp
)
echo "DONE!"
echo "Run \`docker pull emscripten/emsdk\` to get latest docker image"