blob: 8907de1ce36f860ce721a8139a07154757cac13c [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
Davide Pesavento5188f312019-03-18 18:38:45 -04009if [[ $JOB_NAME == *"code-coverage" ]]; then
10 COVERAGE="--with-coverage"
11elif [[ -z $DISABLE_ASAN ]]; then
12 ASAN="--with-sanitizer=address"
13fi
14
Davide Pesavento7ef57e22017-10-28 16:58:43 -040015# Cleanup
Davide Pesavento5188f312019-03-18 18:38:45 -040016sudo_preserve_env PATH -- ./waf --color=yes distclean
Davide Pesavento7ef57e22017-10-28 16:58:43 -040017
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
Davide Pesavento5188f312019-03-18 18:38:45 -040024 sudo_preserve_env PATH -- ./waf --color=yes distclean
Davide Pesavento7ef57e22017-10-28 16:58:43 -040025
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
Davide Pesavento5188f312019-03-18 18:38:45 -040031 sudo_preserve_env PATH -- ./waf --color=yes distclean
Davide Pesavento7ef57e22017-10-28 16:58:43 -040032fi
33
Alexander Afanasyev40491df2018-03-09 16:29:52 -050034# Configure/build in debug mode with tests
Davide Pesavento5188f312019-03-18 18:38:45 -040035./waf --color=yes configure --debug --with-tests $ASAN $COVERAGE
Davide Pesavento7ef57e22017-10-28 16:58:43 -040036./waf --color=yes build -j${WAF_JOBS:-1}
37
38# (tests will be run against debug version)
39
40# Install
Davide Pesavento5188f312019-03-18 18:38:45 -040041sudo_preserve_env PATH -- ./waf --color=yes install
Davide Pesavento7ef57e22017-10-28 16:58:43 -040042
43if has Linux $NODE_LABELS; then
44 sudo ldconfig
45elif has FreeBSD $NODE_LABELS; then
46 sudo ldconfig -a
47fi