blob: 2ecdfdc5568c95207112d3f66aa6df37c9851101 [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
Davide Pesavento437adfe2018-01-11 02:20:42 -050013if [[ $JOB_NAME == *"code-coverage" ]]; then
14 COVERAGE="--with-coverage"
15elif [[ -z $DISABLE_ASAN ]]; then
16 ASAN="--with-sanitizer=address"
17fi
18
Davide Pesavento813df802017-08-20 20:53:54 -040019# Cleanup
20sudo env "PATH=$PATH" ./waf --color=yes distclean
21
22if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
Davide Pesavento6ebfd7c2017-08-26 17:52:54 -040023 # Configure/build in optimized mode with tests
24 ./waf --color=yes configure --with-tests
Davide Pesavento813df802017-08-20 20:53:54 -040025 ./waf --color=yes build -j${WAF_JOBS:-1}
26
27 # Cleanup
28 sudo env "PATH=$PATH" ./waf --color=yes distclean
29
30 # Configure/build in optimized mode without tests
31 ./waf --color=yes configure
32 ./waf --color=yes build -j${WAF_JOBS:-1}
33
34 # Cleanup
35 sudo env "PATH=$PATH" ./waf --color=yes distclean
36fi
37
Davide Pesavento6ebfd7c2017-08-26 17:52:54 -040038# Configure/build in debug mode with tests
Davide Pesavento437adfe2018-01-11 02:20:42 -050039./waf --color=yes configure --debug --with-tests $ASAN $COVERAGE
Davide Pesavento813df802017-08-20 20:53:54 -040040./waf --color=yes build -j${WAF_JOBS:-1}
41
Davide Pesavento6ebfd7c2017-08-26 17:52:54 -040042# (tests will be run against debug version)
Davide Pesavento813df802017-08-20 20:53:54 -040043
44# Install
45sudo env "PATH=$PATH" ./waf --color=yes install