-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathrun
executable file
·51 lines (47 loc) · 808 Bytes
/
run
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
#!/bin/bash
set -eu
if [ $# -lt 1 ]; then
echo 'No task is specified.' >&2
exit 1
fi
args=()
found_double_hyphen=false
for arg in "$@"; do
if [ "$arg" = '--' ]; then
found_double_hyphen=true
continue
fi
if [ "$found_double_hyphen" = true ]; then
args+=("$arg")
fi
done
external_args="${args[@]}"
cd $(dirname $0)
case $1 in
'init-vcpkg' )
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg remove --outdated --recurse
./vcpkg install '@../vcpkg.txt' --triplet=x64-linux
;;
'cmake' )
mkdir -p build
cd build
cmake .. -GNinja $external_args
;;
'b'|'build' )
cd build
ninja
;;
'r'|'run' )
./build/$2 $external_args
;;
't'|'test' )
cd build
ctest -V
;;
* )
echo "Unrecognized task: $1" >&2
exit 1
;;
esac