blob: c514c3a32b5bb840a6dfa50aa00c0b46a4bef34b [file] [log] [blame]
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -07001#!/usr/bin/env bash
Davide Pesavento69857c32020-04-05 16:36:26 -04002set -ex
Davide Pesaventoe0edc4c2016-09-13 18:29:52 +00003
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -07004git submodule sync
Davide Pesavento56c68a32020-03-12 19:26:21 -04005git submodule update --init
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -07006
Davide Pesavento69857c32020-04-05 16:36:26 -04007if [[ -z $DISABLE_ASAN ]]; then
Davide Pesavento167040a2018-01-10 02:41:50 -05008 ASAN="--with-sanitizer=address"
9fi
Davide Pesavento69857c32020-04-05 16:36:26 -040010if [[ $JOB_NAME == *"code-coverage" ]]; then
11 COVERAGE="--with-coverage"
12fi
Davide Pesavento2150da82022-07-08 18:18:51 -040013if [[ -n $DISABLE_PCH ]]; then
Davide Pesavento8f290fc2020-04-12 13:20:07 -040014 PCH="--without-pch"
15fi
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070016
Eric Newberry81a9a862016-12-27 22:59:27 -070017if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
Davide Pesavento56c68a32020-03-12 19:26:21 -040018 # Build in release mode with tests and without precompiled headers
19 ./waf --color=yes configure --with-tests --without-pch
20 ./waf --color=yes build -j$WAF_JOBS
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020021
Davide Pesavento56c68a32020-03-12 19:26:21 -040022 # Cleanup
Davide Pesavento69857c32020-04-05 16:36:26 -040023 ./waf --color=yes distclean
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020024
Davide Pesavento56c68a32020-03-12 19:26:21 -040025 # Build in release mode without tests, but with "other tests"
Davide Pesavento8f290fc2020-04-12 13:20:07 -040026 ./waf --color=yes configure --with-other-tests $PCH
Davide Pesavento56c68a32020-03-12 19:26:21 -040027 ./waf --color=yes build -j$WAF_JOBS
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020028
Davide Pesavento56c68a32020-03-12 19:26:21 -040029 # Cleanup
Davide Pesavento69857c32020-04-05 16:36:26 -040030 ./waf --color=yes distclean
Alexander Afanasyev6602b3b2016-03-15 14:14:11 -070031fi
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020032
Davide Pesavento56c68a32020-03-12 19:26:21 -040033# Build in debug mode with tests
Davide Pesavento8f290fc2020-04-12 13:20:07 -040034./waf --color=yes configure --debug --with-tests $ASAN $COVERAGE $PCH
Davide Pesavento56c68a32020-03-12 19:26:21 -040035./waf --color=yes build -j$WAF_JOBS
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020036
Davide Pesavento56c68a32020-03-12 19:26:21 -040037# (tests will be run against the debug version)
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070038
39# Install
Davide Pesaventodda258a2018-09-06 02:43:10 -040040sudo_preserve_env PATH -- ./waf --color=yes install