-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.sh
executable file
·74 lines (60 loc) · 1.01 KB
/
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
dev=false
xcode=false
headless=false
clean=false
project=""
while test $# -gt 0; do
case "$1" in
-d|--development) dev=true; shift;;
-x|--xcode) xcode=true; shift;;
-h|--headless) headless=true; shift;;
-c|--clean) clean=true; shift;;
-p|--project-name)
if [ -n "$2" ]; then
project=$2
shift 2
fi
;;
*) break;;
esac
done
if [ ! -d ./Engine/_Bin ]; then
mkdir Engine/_Bin
fi
cd Engine/_Bin
if [ "$clean" = true ]; then
rm -rf ./*
fi
if [ "$xcode" = true ]; then
flags="-G Xcode"
fi
if [ "$dev" = true ]; then
flags=" $flags -DDEVELOPMENT=ON"
fi
if [ $"headless" = true ]; then
flags=" $flags -DHEADLESS=ON"
fi
if [ -n "$project" ]; then
flags=" $flags -DUSER_PROJECT_NAME=$project"
fi
cmake $flags ../..;
if [ "$xcode" = false ]; then
make
fi
if [ -n "$project" ]; then
cd ../../$project;
if [ ! -d ./Build ]; then
mkdir Build
fi
cd Build
if [ "$clean" = true ]; then
rm -rf ./*
fi
cmake $flags ..;
fi
if [ "$xcode" = false ]; then
make
else
open .
fi