blob: 0c952ec616038dad1022dc3fbadc893b4ea15d1c [file] [log] [blame]
Davide Pesavento956ac312016-09-20 19:11:30 +02001#!/usr/bin/env bash
2set -e
3
4JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5source "$JDIR"/util.sh
6
7set -x
8
Davide Pesavento9a659d02018-01-10 02:55:43 -05009if [[ $JOB_NAME == *"code-coverage" ]]; then
10 COVERAGE="--with-coverage"
11elif [[ -z $DISABLE_ASAN ]]; then
12 ASAN="--with-sanitizer=address"
13fi
14
Davide Pesavento956ac312016-09-20 19:11:30 +020015# Cleanup
Davide Pesavento3f2f4862018-09-11 17:56:55 -040016sudo_preserve_env PATH -- ./waf --color=yes distclean
Davide Pesavento956ac312016-09-20 19:11:30 +020017
Eric Newberry9737aa82016-12-27 23:03:49 -070018if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
Davide Pesavento956ac312016-09-20 19:11:30 +020019 # Configure/build in optimized mode with tests
Davide Pesavento44660cf2017-08-16 00:44:23 -040020 ./waf --color=yes configure --with-tests
21 ./waf --color=yes build -j${WAF_JOBS:-1}
Davide Pesavento956ac312016-09-20 19:11:30 +020022
23 # Cleanup
Davide Pesavento3f2f4862018-09-11 17:56:55 -040024 sudo_preserve_env PATH -- ./waf --color=yes distclean
Davide Pesavento956ac312016-09-20 19:11:30 +020025
26 # Configure/build in optimized mode without tests
Davide Pesavento44660cf2017-08-16 00:44:23 -040027 ./waf --color=yes configure
28 ./waf --color=yes build -j${WAF_JOBS:-1}
Davide Pesavento956ac312016-09-20 19:11:30 +020029
30 # Cleanup
Davide Pesavento3f2f4862018-09-11 17:56:55 -040031 sudo_preserve_env PATH -- ./waf --color=yes distclean
Davide Pesavento956ac312016-09-20 19:11:30 +020032fi
33
34# Configure/build in debug mode with tests
Davide Pesavento9a659d02018-01-10 02:55:43 -050035./waf --color=yes configure --debug --with-tests $ASAN $COVERAGE
Davide Pesavento44660cf2017-08-16 00:44:23 -040036./waf --color=yes build -j${WAF_JOBS:-1}
Davide Pesavento956ac312016-09-20 19:11:30 +020037
38# (tests will be run against debug version)
39
40# Install
Davide Pesavento3f2f4862018-09-11 17:56:55 -040041sudo_preserve_env PATH -- ./waf --color=yes install