blob: fcf207c0de0dcadb0db77a458d7e354df4e8fbf5 [file] [log] [blame]
Davide Pesavento813df802017-08-20 20:53:54 -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
Davide Pesavento6ebfd7c2017-08-26 17:52:54 -040017 # Configure/build in optimized mode with tests
18 ./waf --color=yes configure --with-tests
Davide Pesavento813df802017-08-20 20:53:54 -040019 ./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
Davide Pesavento6ebfd7c2017-08-26 17:52:54 -040032# Configure/build in debug mode with tests
Davide Pesavento813df802017-08-20 20:53:54 -040033if [[ $JOB_NAME == *"code-coverage" ]]; then
34 COVERAGE="--with-coverage"
35elif [[ -n $BUILD_WITH_ASAN || -z $TRAVIS ]]; then
36 ASAN="--with-sanitizer=address"
37fi
Davide Pesavento6ebfd7c2017-08-26 17:52:54 -040038./waf --color=yes configure --debug --with-tests $COVERAGE $ASAN
Davide Pesavento813df802017-08-20 20:53:54 -040039./waf --color=yes build -j${WAF_JOBS:-1}
40
Davide Pesavento6ebfd7c2017-08-26 17:52:54 -040041# (tests will be run against debug version)
Davide Pesavento813df802017-08-20 20:53:54 -040042
43# Install
44sudo env "PATH=$PATH" ./waf --color=yes install