blob: fa2c90100da8288d36ca4a45a13ccc2581f92fc1 [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
Davide Pesavento2150da82022-07-08 18:18:51 -040010if [[ -n $DISABLE_PCH ]]; then
Davide Pesavento8f290fc2020-04-12 13:20:07 -040011 PCH="--without-pch"
12fi
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070013
Davide Pesavento72517b52022-08-13 18:50:55 -040014set -x
15
Eric Newberry81a9a862016-12-27 22:59:27 -070016if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
Davide Pesavento56c68a32020-03-12 19:26:21 -040017 # Build in release mode with tests and without precompiled headers
18 ./waf --color=yes configure --with-tests --without-pch
Davide Pesavento72517b52022-08-13 18:50:55 -040019 ./waf --color=yes build
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020020
Davide Pesavento56c68a32020-03-12 19:26:21 -040021 # Cleanup
Davide Pesavento69857c32020-04-05 16:36:26 -040022 ./waf --color=yes distclean
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020023
Davide Pesavento56c68a32020-03-12 19:26:21 -040024 # Build in release mode without tests, but with "other tests"
Davide Pesavento8f290fc2020-04-12 13:20:07 -040025 ./waf --color=yes configure --with-other-tests $PCH
Davide Pesavento72517b52022-08-13 18:50:55 -040026 ./waf --color=yes build
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020027
Davide Pesavento56c68a32020-03-12 19:26:21 -040028 # Cleanup
Davide Pesavento69857c32020-04-05 16:36:26 -040029 ./waf --color=yes distclean
Alexander Afanasyev6602b3b2016-03-15 14:14:11 -070030fi
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020031
Davide Pesavento56c68a32020-03-12 19:26:21 -040032# Build in debug mode with tests
Davide Pesavento8f290fc2020-04-12 13:20:07 -040033./waf --color=yes configure --debug --with-tests $ASAN $COVERAGE $PCH
Davide Pesavento72517b52022-08-13 18:50:55 -040034./waf --color=yes build
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020035
Davide Pesavento56c68a32020-03-12 19:26:21 -040036# (tests will be run against the debug version)
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070037
38# Install
Davide Pesavento72517b52022-08-13 18:50:55 -040039sudo ./waf --color=yes install