blob: 255c7ddc2bc354dd7405ee4399c657db1e932380 [file] [log] [blame]
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -07001#!/usr/bin/env bash
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -07002set -e
3
Davide Pesaventoe0edc4c2016-09-13 18:29:52 +00004JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5source "$JDIR"/util.sh
6
7set -x
8
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -07009git submodule init
10git submodule sync
11git submodule update
12
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020013# Cleanup
Davide Pesavento8ca138d2017-08-10 21:36:30 -040014sudo env "PATH=$PATH" ./waf --color=yes distclean
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070015
Eric Newberry81a9a862016-12-27 22:59:27 -070016if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
Davide Pesaventoe0edc4c2016-09-13 18:29:52 +000017 # Configure/build in optimized mode with tests
Davide Pesavento9ac95d32017-07-01 01:51:37 -040018 ./waf --color=yes configure --with-tests
19 ./waf --color=yes build -j${WAF_JOBS:-1}
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020020
Alexander Afanasyev6602b3b2016-03-15 14:14:11 -070021 # Cleanup
Davide Pesavento8ca138d2017-08-10 21:36:30 -040022 sudo env "PATH=$PATH" ./waf --color=yes distclean
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020023
Eric Newberry52ae3292017-11-16 13:54:52 -070024 # Configure/build in optimized mode without tests, but with "other tests"
25 ./waf --color=yes configure --with-other-tests
Davide Pesavento9ac95d32017-07-01 01:51:37 -040026 ./waf --color=yes build -j${WAF_JOBS:-1}
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020027
Alexander Afanasyev6602b3b2016-03-15 14:14:11 -070028 # Cleanup
Davide Pesavento8ca138d2017-08-10 21:36:30 -040029 sudo env "PATH=$PATH" ./waf --color=yes distclean
Alexander Afanasyev6602b3b2016-03-15 14:14:11 -070030fi
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020031
Davide Pesaventoe0edc4c2016-09-13 18:29:52 +000032# Configure/build in debug mode with tests and without precompiled headers
Eric Newberry81a9a862016-12-27 22:59:27 -070033if [[ $JOB_NAME == *"code-coverage" ]]; then
Alexander Afanasyevf22ebaf2015-12-17 21:23:05 -080034 COVERAGE="--with-coverage"
Davide Pesavento9ac95d32017-07-01 01:51:37 -040035elif [[ -n $BUILD_WITH_ASAN || -z $TRAVIS ]]; then
Davide Pesavento043c5012016-09-19 17:23:32 +000036 ASAN="--with-sanitizer=address"
Alexander Afanasyevf22ebaf2015-12-17 21:23:05 -080037fi
Davide Pesavento9ac95d32017-07-01 01:51:37 -040038./waf --color=yes configure --debug --with-tests --without-pch $COVERAGE $ASAN
39./waf --color=yes build -j${WAF_JOBS:-1}
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020040
Alexander Afanasyevf22ebaf2015-12-17 21:23:05 -080041# (tests will be run against debug version)
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070042
43# Install
Davide Pesavento8ca138d2017-08-10 21:36:30 -040044sudo env "PATH=$PATH" ./waf --color=yes install