forked from TannerRogalsky/love.js
-
Notifications
You must be signed in to change notification settings - Fork 29
/
build_lovejs.sh
executable file
·37 lines (30 loc) · 931 Bytes
/
build_lovejs.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
#!/bin/bash
set -euo pipefail
cd "$(dirname "$0")"
if [ "$#" -lt "2" ]
then
echo "ERROR! build_lovejs.sh expects two arguments."
echo "usage: ./build_lovejs.sh [PATH/TO/MEGASOURCE] [PATH/TO/EMSDK]"
echo "ex: "
echo "./build_lovejs.sh /home/alexjgriffith/Github/love.js/megasource ~/Github/emsdk"
exit 1
fi
MEGASOURCE=$1
EMSDK=$2
mkdir -p build/release build/compat
source ${EMSDK}/emsdk_env.sh
(
cd build/release
emcmake cmake ${MEGASOURCE} -DLOVE_JIT=0 -DCMAKE_BUILD_TYPE=Release
emmake make -j 6
cp love/love.js* ../../src/release
cp love/love.wasm ../../src/release
cp love/love.worker.js ../../src/release
)
(
cd build/compat
emcmake cmake ${MEGASOURCE} -DLOVE_JIT=0 -DCMAKE_BUILD_TYPE=Release -DLOVEJS_COMPAT=1 -DSEXPORT_ALL=1 -DSMAIN_MODULE=1 -DSERROR_ON_UNDEFINED_SYMBOLS=0
emmake make -j 6
cp love/love.js* ../../src/compat
cp love/love.wasm ../../src/compat
)