forked from lightspark/lightspark
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·43 lines (37 loc) · 808 Bytes
/
build.sh
File metadata and controls
executable file
·43 lines (37 loc) · 808 Bytes
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
#!/bin/bash
# Stop on first error
set -e
if [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then
echo "-h, --help Print this message"
echo "-d, --debug Build Lightspark with debug symbols"
echo "By default, this script does the release build of Lightspark."
exit 0
fi
if ! type cmake > /dev/null 2>&1; then
echo "cmake not found" >&2
exit 1
fi
if ! type make > /dev/null 2>&1; then
echo "make not found" >&2
exit 1
fi
case "$1" in
-d | --debug)
mkdir -p obj-debug
cd obj-debug
cmake -DCMAKE_BUILD_TYPE=Debug ..
;;
-m | --memory)
mkdir -p obj-memory
cd obj-memory
cmake -DCMAKE_BUILD_TYPE=Memory ..
;;
*)
mkdir -p obj-release
cd obj-release
cmake -DCMAKE_BUILD_TYPE=Release ..
;;
esac
# Use all available threads
make -j $(grep -c processor /proc/cpuinfo)
sudo make install