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