-
Notifications
You must be signed in to change notification settings - Fork 4
/
analyze.sh
37 lines (33 loc) · 912 Bytes
/
analyze.sh
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
#!/bin/sh
if test -n "$(which clang-5.0)"; then
CC=clang-5.0 CXX=clang++-5.0 SCAN=scan-build-5.0
elif test -n "$(which clang-4.0)"; then
CC=clang-4.0 CXX=clang++-4.0 SCAN=scan-build-4.0
elif test -n "$(which clang-3.9)"; then
CC=clang-3.9 CXX=clang++-3.9 SCAN=scan-build-3.9
elif test -n "$(which clang-3.8)"; then
CC=clang-3.8 CXX=clang++-3.8 SCAN=scan-build-3.8
elif test -n "$(which clang)"; then
CC=clang CXX=clang++ SCAN=scan-build
else
echo "!! Error: not able to find Clang compiler">&2
exit 1
fi
if test -z "$(which $CXX)"; then
echo "!! Error: not able to find $CXX">&2
exit 1
fi
if test -z "$(which $SCAN)"; then
echo "!! Error: not able to find $SCAN">&2
exit 1
fi
export CC
export CXX
$SCAN -v -v \
--use-cc="$(which $CC)" \
--use-c++="$(which $CXX)" \
cmake -DCMAKE_BUILD_TYPE=Debug .
$SCAN -v -v \
--use-cc="$(which $CC)" \
--use-c++="$(which $CXX)" \
make -j