blob: 9ee5a78dafcc59cf66a2b9af54e1241bb23c9f28 [file] [log] [blame]
Davide Pesavento7ef57e22017-10-28 16:58:43 -04001#!/usr/bin/env bash
2set -e
3
4JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5source "$JDIR"/util.sh
6
7set -x
8
9# Cleanup
10sudo env "PATH=$PATH" ./waf --color=yes distclean
11
12if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
13 # Configure/build in optimized mode with tests
14 ./waf --color=yes configure --with-tests
15 ./waf --color=yes build -j${WAF_JOBS:-1}
16
17 # Cleanup
18 sudo env "PATH=$PATH" ./waf --color=yes distclean
19
20 # Configure/build in optimized mode without tests
21 ./waf --color=yes configure
22 ./waf --color=yes build -j${WAF_JOBS:-1}
23
24 # Cleanup
25 sudo env "PATH=$PATH" ./waf --color=yes distclean
26fi
27
Alexander Afanasyev40491df2018-03-09 16:29:52 -050028# Configure/build in debug mode with tests
Davide Pesavento7ef57e22017-10-28 16:58:43 -040029if [[ $JOB_NAME == *"code-coverage" ]]; then
30 COVERAGE="--with-coverage"
31elif [[ -n $BUILD_WITH_ASAN || -z $TRAVIS ]]; then
32 ASAN="--with-sanitizer=address"
33fi
Alexander Afanasyev40491df2018-03-09 16:29:52 -050034./waf --color=yes configure --debug --with-tests $COVERAGE $ASAN
Davide Pesavento7ef57e22017-10-28 16:58:43 -040035./waf --color=yes build -j${WAF_JOBS:-1}
36
37# (tests will be run against debug version)
38
39# Install
40sudo env "PATH=$PATH" ./waf --color=yes install
41
42if has Linux $NODE_LABELS; then
43 sudo ldconfig
44elif has FreeBSD $NODE_LABELS; then
45 sudo ldconfig -a
46fi