blob: 9d415d565fa18f1ba7f592b638390bc11e5e1ed9 [file] [log] [blame]
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -07001#!/usr/bin/env bash
Davide Pesavento72517b52022-08-13 18:50:55 -04002set -eo pipefail
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -07003
Davide Pesavento69857c32020-04-05 16:36:26 -04004if [[ -z $DISABLE_ASAN ]]; then
Davide Pesavento167040a2018-01-10 02:41:50 -05005 ASAN="--with-sanitizer=address"
6fi
Davide Pesavento69857c32020-04-05 16:36:26 -04007if [[ $JOB_NAME == *"code-coverage" ]]; then
8 COVERAGE="--with-coverage"
9fi
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070010
Davide Pesavento72517b52022-08-13 18:50:55 -040011set -x
12
Eric Newberry81a9a862016-12-27 22:59:27 -070013if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
Davide Pesavento56c68a32020-03-12 19:26:21 -040014 # Build in release mode with tests and without precompiled headers
15 ./waf --color=yes configure --with-tests --without-pch
Davide Pesavento72517b52022-08-13 18:50:55 -040016 ./waf --color=yes build
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020017
Davide Pesavento56c68a32020-03-12 19:26:21 -040018 # Cleanup
Davide Pesavento69857c32020-04-05 16:36:26 -040019 ./waf --color=yes distclean
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020020
Davide Pesaventoa1b15192024-02-09 19:27:34 -050021 # Build in release mode with "other tests" only
22 ./waf --color=yes configure --with-other-tests
Davide Pesavento72517b52022-08-13 18:50:55 -040023 ./waf --color=yes build
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020024
Davide Pesavento56c68a32020-03-12 19:26:21 -040025 # Cleanup
Davide Pesavento69857c32020-04-05 16:36:26 -040026 ./waf --color=yes distclean
Alexander Afanasyev6602b3b2016-03-15 14:14:11 -070027fi
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020028
Davide Pesavento56c68a32020-03-12 19:26:21 -040029# Build in debug mode with tests
Davide Pesaventoa1b15192024-02-09 19:27:34 -050030./waf --color=yes configure --debug --with-tests $ASAN $COVERAGE
Davide Pesavento72517b52022-08-13 18:50:55 -040031./waf --color=yes build
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020032
Davide Pesavento56c68a32020-03-12 19:26:21 -040033# (tests will be run against the debug version)
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070034
35# Install
Davide Pesavento72517b52022-08-13 18:50:55 -040036sudo ./waf --color=yes install