-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·49 lines (43 loc) · 838 Bytes
/
setup.sh
File metadata and controls
executable file
·49 lines (43 loc) · 838 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
44
45
46
47
48
49
#!/usr/bin/env bash
set -e
RUN_CMAKE=true
BUILD_PROJECT=false
RUN_PROJECT=false
BUILD_DEBUG=false
# Process options
while test $# -gt 0
do
case "$1" in
-b) BUILD_PROJECT=true
;;
-r) BUILD_PROJECT=true
RUN_PROJECT=true
;;
-g) BUILD_DEBUG=true
;;
-*) echo "unknown option $1"
exit 1
;;
*) echo "unexpected positional argument $1"
exit 1
;;
esac
shift
done
if $RUN_CMAKE; then
CMAKE_FLAGS=""
if $BUILD_DEBUG; then
CMAKE_FLAGS+=" -DCMAKE_BUILD_TYPE=Debug"
else
CMAKE_FLAGS+=" -DCMAKE_BUILD_TYPE=MinSizeRel"
fi
pushd build
cmake ${CMAKE_FLAGS} ..
popd
fi
if $BUILD_PROJECT; then
make -C build
fi
if $RUN_PROJECT; then
build/bin/golf
fi