forked from polatory/polatory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun
executable file
·36 lines (32 loc) · 778 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
#!/bin/sh
set -eu
if [ $# -lt 1 ]; then
echo 'No task is specified.' >&2
exit 1
fi
if [ "$(uname)" = 'Darwin' ]; then
export CC="${CC:-$(brew --prefix)/opt/llvm/bin/clang}"
export CXX="${CXX:-$(brew --prefix)/opt/llvm/bin/clang++}"
elif [ "$(uname)" = 'Linux' ]; then
export CC="${CC:-clang-17}"
export CXX="${CXX:-clang++-17}"
if [ "$CXX" = 'clang++-17' ]; then
export CXXFLAGS="${CXXFLAGS:--stdlib=libc++}"
fi
fi
cd "$(dirname "$0")"
case $1 in
'c'|'configure' )
cmake -Bbuild -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake
;;
'b'|'build' )
cmake --build build
;;
't'|'test' )
ctest -V --test-dir build
;;
* )
echo "Unrecognized task: $1" >&2
exit 1
;;
esac