blob: 199ed203822859b49ca6ddd901302b78b5873d90 [file] [log] [blame]
Davide Pesavento4a315b32018-11-24 14:32:19 -05001#!/usr/bin/env bash
Davide Pesavento423553e2022-08-19 20:46:06 -04002set -eo pipefail
Davide Pesavento4a315b32018-11-24 14:32:19 -05003
Davide Pesaventofee7ee32020-04-15 02:45:07 -04004if [[ -z $DISABLE_ASAN ]]; then
Davide Pesavento4a315b32018-11-24 14:32:19 -05005 ASAN="--with-sanitizer=address"
6fi
Davide Pesaventofee7ee32020-04-15 02:45:07 -04007if [[ $JOB_NAME == *"code-coverage" ]]; then
8 COVERAGE="--with-coverage"
Davide Pesavento4a315b32018-11-24 14:32:19 -05009fi
10
Davide Pesavento423553e2022-08-19 20:46:06 -040011set -x
12
Davide Pesaventofee7ee32020-04-15 02:45:07 -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 Pesavento423553e2022-08-19 20:46:06 -040016 ./waf --color=yes build
Davide Pesavento4a315b32018-11-24 14:32:19 -050017
Davide Pesaventofee7ee32020-04-15 02:45:07 -040018 # Cleanup
19 ./waf --color=yes distclean
20
21 # Build in release mode without tests
22 ./waf --color=yes configure
Davide Pesavento423553e2022-08-19 20:46:06 -040023 ./waf --color=yes build
Davide Pesaventofee7ee32020-04-15 02:45:07 -040024
25 # Cleanup
26 ./waf --color=yes distclean
27fi
28
29# Build in debug mode with tests
30./waf --color=yes configure --debug --with-tests $ASAN $COVERAGE
Davide Pesavento423553e2022-08-19 20:46:06 -040031./waf --color=yes build
Davide Pesaventofee7ee32020-04-15 02:45:07 -040032
33# (tests will be run against the debug version)
Davide Pesavento4a315b32018-11-24 14:32:19 -050034
35# Install
Davide Pesavento423553e2022-08-19 20:46:06 -040036sudo ./waf --color=yes install