This repository was archived by the owner on May 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·63 lines (59 loc) · 1.35 KB
/
build.sh
File metadata and controls
executable file
·63 lines (59 loc) · 1.35 KB
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
#!/bin/bash
function clean() {
if [ -d "build" ]; then
rm -rf build/*
echo "build directory has been removed."
else
echo "build directory does not exist."
fi
if [ -d ".doxygen" ]; then
rm -rf .doxygen/*
echo ".doxygen directory has been removed."
else
echo ".doxygen directory does not exist."
fi
if [ -d "lib" ]; then
rm -rf lib/*
echo "lib directory has been removed."
else
echo "lib directory does not exist."
fi
if [ -f "arcade" ]; then
rm arcade
echo "arcade binary has been removed."
else
echo "arcade binary does not exist."
fi
}
function build() {
debug=$1
if [ ! -d "build" ]; then
mkdir -p build
fi
cd build || exit 1
if [ "$debug" == "true" ]; then
cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DUSE_CLANG_TIDY=ON && cmake --build .
else
cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release && cmake --build .
fi
}
if [ $# -eq 0 ]; then
echo "Usage $0 build [debug] | clean"
exit 1
fi
case $1 in
build)
if [ "$2" == "debug" ]; then
build true
else
build false
fi
;;
clean)
clean
;;
*)
echo "Usage $0 build [debug] | clean"
exit 1
;;
esac