blob: cfa32f830f576644f7f445b660e73ba6bc3fdc91 [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 Pesavento167040a2018-01-10 02:41:50 -050013if [[ $JOB_NAME == *"code-coverage" ]]; then
14 COVERAGE="--with-coverage"
15elif [[ -z $DISABLE_ASAN ]]; then
16 ASAN="--with-sanitizer=address"
17fi
18
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020019# Cleanup
Davide Pesaventodda258a2018-09-06 02:43:10 -040020sudo_preserve_env PATH -- ./waf --color=yes distclean
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070021
Eric Newberry81a9a862016-12-27 22:59:27 -070022if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
Davide Pesaventoe0edc4c2016-09-13 18:29:52 +000023 # Configure/build in optimized mode with tests
Davide Pesavento9ac95d32017-07-01 01:51:37 -040024 ./waf --color=yes configure --with-tests
25 ./waf --color=yes build -j${WAF_JOBS:-1}
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020026
Alexander Afanasyev6602b3b2016-03-15 14:14:11 -070027 # Cleanup
Davide Pesaventodda258a2018-09-06 02:43:10 -040028 sudo_preserve_env PATH -- ./waf --color=yes distclean
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020029
Eric Newberry52ae3292017-11-16 13:54:52 -070030 # Configure/build in optimized mode without tests, but with "other tests"
31 ./waf --color=yes configure --with-other-tests
Davide Pesavento9ac95d32017-07-01 01:51:37 -040032 ./waf --color=yes build -j${WAF_JOBS:-1}
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020033
Alexander Afanasyev6602b3b2016-03-15 14:14:11 -070034 # Cleanup
Davide Pesaventodda258a2018-09-06 02:43:10 -040035 sudo_preserve_env PATH -- ./waf --color=yes distclean
Alexander Afanasyev6602b3b2016-03-15 14:14:11 -070036fi
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020037
Davide Pesaventoe0edc4c2016-09-13 18:29:52 +000038# Configure/build in debug mode with tests and without precompiled headers
Davide Pesavento167040a2018-01-10 02:41:50 -050039./waf --color=yes configure --debug --with-tests --without-pch $ASAN $COVERAGE
Davide Pesavento9ac95d32017-07-01 01:51:37 -040040./waf --color=yes build -j${WAF_JOBS:-1}
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020041
Alexander Afanasyevf22ebaf2015-12-17 21:23:05 -080042# (tests will be run against debug version)
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070043
44# Install
Davide Pesaventodda258a2018-09-06 02:43:10 -040045sudo_preserve_env PATH -- ./waf --color=yes install