-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprojenv.sh
More file actions
executable file
·53 lines (49 loc) · 976 Bytes
/
Copy pathprojenv.sh
File metadata and controls
executable file
·53 lines (49 loc) · 976 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
#!/usr/bin/env bash
build() {
target=$1
if [ ! -d build ]; then
mkdir build
cmake -DCMAKE_C_COMPILER:FILEPATH=clang -DCMAKE_CXX_COMPILER:FILEPATH=clang++ --no-warn-unused-cli -S . -B build -G Ninja
fi
if [ -z "$target" ]; then
cmake --build build --config Debug --target all --
else
cmake --build build --config Debug --target "$target"
fi
}
scrabble() {
build scrabble
exec_path="build/bin/scrabble"
if [ -x "$exec_path" ]; then
"$exec_path" "$1" "$2" "$3"
else
echo "Error: '$exec_path' not found"
fi
}
test() {
build scrabble_test
exec_path="build/bin/scrabble_test"
if [ -x "$exec_path" ]; then
"$exec_path" "$1" "$2" "$3"
else
echo "Error: '$exec_path' not found"
fi
}
case "$1" in
build)
shift
build "$@"
;;
scrabble)
shift
scrabble "$@"
;;
test)
shift
test "$@"
;;
*)
echo "Usage: $0 {build [target]|scrabble [args]|test [args]}"
exit 1
;;
esac