blob: d6a3ee995503f30de7da2db08fa11ff1325e5acd [file] [log] [blame]
Alexander Afanasyevf34a3552017-08-13 21:17:05 -04001#!/usr/bin/env bash
Davide Pesavento1d484532022-08-19 22:08:31 -04002set -eo pipefail
Alexander Afanasyevf34a3552017-08-13 21:17:05 -04003
Davide Pesavento4a160042020-04-13 16:50:02 -04004if [[ -z $DISABLE_ASAN ]]; then
Alexander Afanasyevf34a3552017-08-13 21:17:05 -04005 ASAN="--with-sanitizer=address"
6fi
Davide Pesavento4a160042020-04-13 16:50:02 -04007if [[ $JOB_NAME == *"code-coverage" ]]; then
8 COVERAGE="--with-coverage"
9fi
Alexander Afanasyevf34a3552017-08-13 21:17:05 -040010
Davide Pesavento1d484532022-08-19 22:08:31 -040011set -x
12
Davide Pesavento4a160042020-04-13 16:50:02 -040013if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
14 # Build in release mode with tests
15 ./waf --color=yes configure --with-tests
Davide Pesavento1d484532022-08-19 22:08:31 -040016 ./waf --color=yes build
Davide Pesavento4a160042020-04-13 16:50:02 -040017
18 # Cleanup
19 ./waf --color=yes distclean
20
21 # Build in release mode without tests
22 ./waf --color=yes configure
Davide Pesavento1d484532022-08-19 22:08:31 -040023 ./waf --color=yes build
Davide Pesavento4a160042020-04-13 16:50:02 -040024
25 # Cleanup
26 ./waf --color=yes distclean
27fi
28
29# Build in debug mode with tests and examples
30./waf --color=yes configure --debug --with-tests --with-examples $ASAN $COVERAGE
Davide Pesavento1d484532022-08-19 22:08:31 -040031./waf --color=yes build
Davide Pesavento4a160042020-04-13 16:50:02 -040032
33# (tests will be run against the debug version)
Alexander Afanasyevf34a3552017-08-13 21:17:05 -040034
35# Install
Davide Pesavento1d484532022-08-19 22:08:31 -040036sudo ./waf --color=yes install