blob: 2a60f0d70d7b8691535995771ca185af0e9725ea [file] [log] [blame]
Davide Pesavento4a315b32018-11-24 14:32:19 -05001#!/usr/bin/env bash
Davide Pesaventofee7ee32020-04-15 02:45:07 -04002set -ex
Davide Pesavento4a315b32018-11-24 14:32:19 -05003
Davide Pesaventofee7ee32020-04-15 02:45:07 -04004git submodule sync
5git submodule update --init
Davide Pesavento4a315b32018-11-24 14:32:19 -05006
Davide Pesaventofee7ee32020-04-15 02:45:07 -04007if [[ -z $DISABLE_ASAN ]]; then
Davide Pesavento4a315b32018-11-24 14:32:19 -05008 ASAN="--with-sanitizer=address"
9fi
Davide Pesaventofee7ee32020-04-15 02:45:07 -040010if [[ $JOB_NAME == *"code-coverage" ]]; then
11 COVERAGE="--with-coverage"
Davide Pesavento4a315b32018-11-24 14:32:19 -050012fi
13
Davide Pesaventofee7ee32020-04-15 02:45:07 -040014if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
15 # Build in release mode with tests
16 ./waf --color=yes configure --with-tests
17 ./waf --color=yes build -j$WAF_JOBS
Davide Pesavento4a315b32018-11-24 14:32:19 -050018
Davide Pesaventofee7ee32020-04-15 02:45:07 -040019 # Cleanup
20 ./waf --color=yes distclean
21
22 # Build in release mode without tests
23 ./waf --color=yes configure
24 ./waf --color=yes build -j$WAF_JOBS
25
26 # Cleanup
27 ./waf --color=yes distclean
28fi
29
30# Build in debug mode with tests
31./waf --color=yes configure --debug --with-tests $ASAN $COVERAGE
32./waf --color=yes build -j$WAF_JOBS
33
34# (tests will be run against the debug version)
Davide Pesavento4a315b32018-11-24 14:32:19 -050035
36# Install
37sudo_preserve_env PATH -- ./waf --color=yes install