NMEA: benchmark for sentence STN added.
[marnav.git] / bin / static-analysis-clang
blobc8bcf5784af301ab4b024c0dd7a4639db3a392e5
1 #!/bin/bash -u
3 export SCRIPT_BASE=$(dirname `readlink -f $0`)
4 export BASE=${SCRIPT_BASE}/..
5 export BUILD=${BASE}/build
7 CLANG_VERSION=3.9
8 CLANG_ANALYZER=/usr/share/clang/scan-build-${CLANG_VERSION}/libexec/c++-analyzer
9 CLANG_SCAN_BUILD=/usr/share/clang/scan-build-${CLANG_VERSION}/bin/scan-build
10 CLANG_COMPILER=/usr/bin/clang++-${CLANG_VERSION}
12 if [ ! -x ${CLANG_ANALYZER} ] ; then
13 echo "error: clang analyzer not found: ${CLANG_ANALYZER}"
14 exit 1
17 if [ ! -x ${CLANG_SCAN_BUILD} ] ; then
18 echo "error: clang scan build not found: ${CLANG_SCAN_BUILD}"
19 exit 1
22 if [ ! -x ${CLANG_COMPILER} ] ; then
23 echo "error: clang compiler not found: ${CLANG_COMPILER}"
24 exit 1
27 if [ -d ${BUILD} ] ; then
28 echo ""
29 echo "warning: directory 'build' already exists."
30 echo ""
31 else
32 mkdir -p ${BUILD}
35 if [ ! -d ${BUILD}/doc/analysis ] ; then
36 mkdir -p ${BUILD}/doc/analysis
39 cd ${BUILD}
40 cmake -DCMAKE_CXX_COMPILER=${CLANG_ANALYZER} ..
41 ${CLANG_SCAN_BUILD} -o doc/analysis --use-analyzer=${CLANG_COMPILER} make -j 4 marnav
43 exit 0