blob: 0c952ec616038dad1022dc3fbadc893b4ea15d1c [file] [log] [blame]
Davide Pesavento4a315b32018-11-24 14:32:19 -05001#!/usr/bin/env bash
2set -e
3
4JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5source "$JDIR"/util.sh
6
7set -x
8
9if [[ $JOB_NAME == *"code-coverage" ]]; then
10 COVERAGE="--with-coverage"
11elif [[ -z $DISABLE_ASAN ]]; then
12 ASAN="--with-sanitizer=address"
13fi
14
15# Cleanup
16sudo_preserve_env PATH -- ./waf --color=yes distclean
17
18if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
19 # Configure/build in optimized mode with tests
20 ./waf --color=yes configure --with-tests
21 ./waf --color=yes build -j${WAF_JOBS:-1}
22
23 # Cleanup
24 sudo_preserve_env PATH -- ./waf --color=yes distclean
25
26 # Configure/build in optimized mode without tests
27 ./waf --color=yes configure
28 ./waf --color=yes build -j${WAF_JOBS:-1}
29
30 # Cleanup
31 sudo_preserve_env PATH -- ./waf --color=yes distclean
32fi
33
34# Configure/build in debug mode with tests
35./waf --color=yes configure --debug --with-tests $ASAN $COVERAGE
36./waf --color=yes build -j${WAF_JOBS:-1}
37
38# (tests will be run against debug version)
39
40# Install
41sudo_preserve_env PATH -- ./waf --color=yes install