blob: b902b1ed301ca3625e6e35d3c60164eb8dae8904 [file] [log] [blame]
Zhiyi Zhang8617a792017-01-17 16:45:56 -08001#!/usr/bin/env bash
2set -e
3
4JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5source "$JDIR"/util.sh
6
7set -x
8
Davide Pesaventocf9ffe42018-01-21 22:21:53 -05009if [[ $JOB_NAME == *"code-coverage" ]]; then
10 COVERAGE="--with-coverage"
11elif [[ -z $DISABLE_ASAN ]]; then
12 ASAN="--with-sanitizer=address"
13fi
Zhiyi Zhang8617a792017-01-17 16:45:56 -080014
15# Cleanup
Davide Pesaventocf9ffe42018-01-21 22:21:53 -050016sudo env "PATH=$PATH" ./waf --color=yes distclean
Zhiyi Zhang8617a792017-01-17 16:45:56 -080017
18if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
19 # Configure/build in optimized mode with tests
Davide Pesaventocf9ffe42018-01-21 22:21:53 -050020 ./waf --color=yes configure --with-tests
21 ./waf --color=yes build -j${WAF_JOBS:-1}
Zhiyi Zhang8617a792017-01-17 16:45:56 -080022
23 # Cleanup
Davide Pesaventocf9ffe42018-01-21 22:21:53 -050024 sudo env "PATH=$PATH" ./waf --color=yes distclean
Zhiyi Zhang8617a792017-01-17 16:45:56 -080025
26 # Configure/build in optimized mode without tests
Davide Pesaventocf9ffe42018-01-21 22:21:53 -050027 ./waf --color=yes configure
28 ./waf --color=yes build -j${WAF_JOBS:-1}
Zhiyi Zhang8617a792017-01-17 16:45:56 -080029
30 # Cleanup
Davide Pesaventocf9ffe42018-01-21 22:21:53 -050031 sudo env "PATH=$PATH" ./waf --color=yes distclean
Zhiyi Zhang8617a792017-01-17 16:45:56 -080032fi
33
34# Configure/build in debug mode with tests
Davide Pesaventocf9ffe42018-01-21 22:21:53 -050035./waf --color=yes configure --debug --with-tests $ASAN $COVERAGE
36./waf --color=yes build -j${WAF_JOBS:-1}
Zhiyi Zhang8617a792017-01-17 16:45:56 -080037
38# (tests will be run against debug version)
39
40# Install
Davide Pesaventocf9ffe42018-01-21 22:21:53 -050041sudo env "PATH=$PATH" ./waf --color=yes install
Zhiyi Zhang7021a932017-03-17 10:26:51 -070042
43if has Linux $NODE_LABELS; then
44 sudo ldconfig
45elif has FreeBSD $NODE_LABELS; then
46 sudo ldconfig -a
47fi