blob: 61eb4b0267c7fbed336520b8983f0c713b8f9601 [file] [log] [blame]
Alexander Afanasyevf34a3552017-08-13 21:17:05 -04001#!/usr/bin/env bash
Davide Pesavento4a160042020-04-13 16:50:02 -04002set -ex
Alexander Afanasyevf34a3552017-08-13 21:17:05 -04003
Alexander Afanasyevf34a3552017-08-13 21:17:05 -04004git submodule sync
Davide Pesavento4a160042020-04-13 16:50:02 -04005git submodule update --init
Alexander Afanasyevf34a3552017-08-13 21:17:05 -04006
Davide Pesavento4a160042020-04-13 16:50:02 -04007if [[ -z $DISABLE_ASAN ]]; then
Alexander Afanasyevf34a3552017-08-13 21:17:05 -04008 ASAN="--with-sanitizer=address"
9fi
Davide Pesavento4a160042020-04-13 16:50:02 -040010if [[ $JOB_NAME == *"code-coverage" ]]; then
11 COVERAGE="--with-coverage"
12fi
Alexander Afanasyevf34a3552017-08-13 21:17:05 -040013
Davide Pesavento4a160042020-04-13 16:50:02 -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
18
19 # 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 and examples
31./waf --color=yes configure --debug --with-tests --with-examples $ASAN $COVERAGE
32./waf --color=yes build -j$WAF_JOBS
33
34# (tests will be run against the debug version)
Alexander Afanasyevf34a3552017-08-13 21:17:05 -040035
36# Install
Davide Pesavento4a160042020-04-13 16:50:02 -040037sudo_preserve_env PATH -- ./waf --color=yes install