summaryrefslogtreecommitdiff
path: root/citools
diff options
context:
space:
mode:
authorVincent Sanders <vincent.sanders@collabora.co.uk>2013-05-11 11:35:03 +0100
committerVincent Sanders <vincent.sanders@collabora.co.uk>2013-05-11 11:35:03 +0100
commit396c5a5ff53acd5042600ec72368ec139f9345e5 (patch)
tree0b6f27e552d4be7e21b79b46a88d071265707877 /citools
parent2558cc2c3108162defaa2f5d20b7201696f220fc (diff)
downloadbuildsystem-396c5a5ff53acd5042600ec72368ec139f9345e5.tar.gz
buildsystem-396c5a5ff53acd5042600ec72368ec139f9345e5.tar.bz2
add static build capability
Diffstat (limited to 'citools')
-rwxr-xr-xcitools/jenkins-build.sh46
1 files changed, 41 insertions, 5 deletions
diff --git a/citools/jenkins-build.sh b/citools/jenkins-build.sh
index 894ee97..cfed262 100755
--- a/citools/jenkins-build.sh
+++ b/citools/jenkins-build.sh
@@ -24,9 +24,12 @@
#
# This script may be executed by jenkins jobs that use the core buildsystem
#
-# Usage: jenkins-build.sh [install|test-install|coverage]
+# Usage: jenkins-build.sh [install|test-install|coverage|static]
#
-
+# install - build and install
+# test-install - build, test and install
+# coverage - run coverage
+# static - perform a staic anaysis
# TARGET must be in the environment and set correctly
if [ "x${TARGET}" = "x" ];then
@@ -47,10 +50,11 @@ NATIVE_TARGET=$(uname -s)
TARGET_TEST=
TARGET_INSTALL=
TARGET_COVERAGE=
+TARGET_STATIC=
TARGET_BUILD="release"
# change defaults based on build parameter
-case $1 in
+case "$1" in
"install")
TARGET_INSTALL=${TARGET}
;;
@@ -62,12 +66,31 @@ case $1 in
export CCACHE=
;;
- "test-install"|*)
+ "static")
+ TARGET_STATIC=${TARGET}
+ TARGET_BUILD="debug"
+ # need to disable ccache on static builds
+ export CCACHE=
+ ;;
+
+ "test-install"|"")
# Currently most tests do not work on targets except for Linux
# TARGET_TEST=${NATIVE_TARGET}
TARGET_TEST="Linux"
TARGET_INSTALL=${TARGET}
;;
+
+ *)
+ cat <<EOF
+Usage: jenkins-build.sh [install|test-install|coverage|static]
+
+ install build and install
+ test-install build, test and install
+ coverage run coverage
+ static perform a staic anaysis
+EOF
+ exit 1
+ ;;
esac
# currently core buildsystem doesnt use triplets so we need to adjust for that
@@ -104,12 +127,25 @@ export PATH=${PATH}:${PREFIX}/bin
# clean target is always first
make Q= clean TARGET=${TARGET_TARGET} BUILD=${TARGET_BUILD}
-# either a coverage build or a normal one
+# build as per type requested
if [ "x${TARGET}" = "x${TARGET_COVERAGE}" ]; then
+ # Coverage Build
make Q= TARGET=${TARGET_TARGET} BUILD=${TARGET_BUILD} coverage
gcovr -x -r .. -o coverage.xml
+
+elif [ "x${TARGET}" = "x${TARGET_STATIC}" ]; then
+ # static build
+ rm -rf clangScanBuildReports
+
+ scan-build -o clangScanBuildReports -v --use-cc clang --use-analyzer=/usr/bin/clang make BUILD=debug
+
+ # clean up after
+ make Q= clean TARGET=${TARGET_TARGET} BUILD=${TARGET_BUILD}
+
else
+ # Normal build
make Q= TARGET=${TARGET_TARGET} BUILD=${TARGET_BUILD}
+
fi
# test if appropriate