-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·57 lines (48 loc) · 987 Bytes
/
build.sh
File metadata and controls
executable file
·57 lines (48 loc) · 987 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
50
51
52
53
54
55
56
57
#!/bin/bash
set -e
refresh=false
generate=false
release=false
build=false
while test $# -gt 0; do
case "$1" in
-r|--refresh)
refresh=true
shift
;;
-g|--generate)
generate=true
shift
;;
-R|--release)
release=true
shift
;;
-B|--build)
build=true
shift
;;
*)
break
esac
done
if [[ $refresh == true && -d build ]]; then
echo "[BUILD_SCRIPT] Cleaning the build directory..."
rm -rf build
fi
preset="Debug"
if [ $release == true ]; then
preset="Release"
fi
if [ $build == true ]; then
cmake --build --preset $preset
echo "[BUILD_SCRIPT] Build-only mode"
exit
fi
echo "[BUILD_SCRIPT] Generating build files."
cmake "$@" --preset $preset
if [ $generate == true ]; then
echo "[BUILD_SCRIPT] Generate-only mode"
exit
fi
cmake --build --preset $preset