blob: 854c4ed02a40d8c82b11ef124fbba23e1013b583 [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
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070013
Eric Newberry81a9a862016-12-27 22:59:27 -070014if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
Davide Pesavento56c68a32020-03-12 19:26:21 -040015 # Build in release mode with tests and without precompiled headers
16 ./waf --color=yes configure --with-tests --without-pch
17 ./waf --color=yes build -j$WAF_JOBS
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020018
Davide Pesavento56c68a32020-03-12 19:26:21 -040019 # Cleanup
Davide Pesavento69857c32020-04-05 16:36:26 -040020 ./waf --color=yes distclean
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020021
Davide Pesavento56c68a32020-03-12 19:26:21 -040022 # Build in release mode without tests, but with "other tests"
23 ./waf --color=yes configure --with-other-tests
24 ./waf --color=yes build -j$WAF_JOBS
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020025
Davide Pesavento56c68a32020-03-12 19:26:21 -040026 # Cleanup
Davide Pesavento69857c32020-04-05 16:36:26 -040027 ./waf --color=yes distclean
Alexander Afanasyev6602b3b2016-03-15 14:14:11 -070028fi
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020029
Davide Pesavento56c68a32020-03-12 19:26:21 -040030# Build in debug mode with tests
31./waf --color=yes configure --debug --with-tests $ASAN $COVERAGE
32./waf --color=yes build -j$WAF_JOBS
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020033
Davide Pesavento56c68a32020-03-12 19:26:21 -040034# (tests will be run against the debug version)
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070035
36# Install
Davide Pesaventodda258a2018-09-06 02:43:10 -040037sudo_preserve_env PATH -- ./waf --color=yes install