blob: 3879bb4ef668f7f810ce973c5fcd910cc064275b [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 sync
Davide Pesavento56c68a32020-03-12 19:26:21 -040010git submodule update --init
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070011
Davide Pesavento167040a2018-01-10 02:41:50 -050012if [[ $JOB_NAME == *"code-coverage" ]]; then
13 COVERAGE="--with-coverage"
14elif [[ -z $DISABLE_ASAN ]]; then
15 ASAN="--with-sanitizer=address"
16fi
17
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020018# Cleanup
Davide Pesaventodda258a2018-09-06 02:43:10 -040019sudo_preserve_env PATH -- ./waf --color=yes distclean
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070020
Eric Newberry81a9a862016-12-27 22:59:27 -070021if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
Davide Pesavento56c68a32020-03-12 19:26:21 -040022 # Build in release mode with tests and without precompiled headers
23 ./waf --color=yes configure --with-tests --without-pch
24 ./waf --color=yes build -j$WAF_JOBS
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020025
Davide Pesavento56c68a32020-03-12 19:26:21 -040026 # Cleanup
27 sudo_preserve_env PATH -- ./waf --color=yes distclean
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020028
Davide Pesavento56c68a32020-03-12 19:26:21 -040029 # Build in release mode without tests, but with "other tests"
30 ./waf --color=yes configure --with-other-tests
31 ./waf --color=yes build -j$WAF_JOBS
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020032
Davide Pesavento56c68a32020-03-12 19:26:21 -040033 # Cleanup
34 sudo_preserve_env PATH -- ./waf --color=yes distclean
Alexander Afanasyev6602b3b2016-03-15 14:14:11 -070035fi
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020036
Davide Pesavento56c68a32020-03-12 19:26:21 -040037# Build in debug mode with tests
38./waf --color=yes configure --debug --with-tests $ASAN $COVERAGE
39./waf --color=yes build -j$WAF_JOBS
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020040
Davide Pesavento56c68a32020-03-12 19:26:21 -040041# (tests will be run against the debug version)
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070042
43# Install
Davide Pesaventodda258a2018-09-06 02:43:10 -040044sudo_preserve_env PATH -- ./waf --color=yes install