blob: 58c8b061124f9ecb5d7579c1153390e49c95869c [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 Pesavento8f290fc2020-04-12 13:20:07 -040013if has CentOS-8 $NODE_LABELS; then
14 # https://bugzilla.redhat.com/show_bug.cgi?id=1721553
15 PCH="--without-pch"
16fi
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070017
Eric Newberry81a9a862016-12-27 22:59:27 -070018if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
Davide Pesavento56c68a32020-03-12 19:26:21 -040019 # Build in release mode with tests and without precompiled headers
20 ./waf --color=yes configure --with-tests --without-pch
21 ./waf --color=yes build -j$WAF_JOBS
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020022
Davide Pesavento56c68a32020-03-12 19:26:21 -040023 # Cleanup
Davide Pesavento69857c32020-04-05 16:36:26 -040024 ./waf --color=yes distclean
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020025
Davide Pesavento56c68a32020-03-12 19:26:21 -040026 # Build in release mode without tests, but with "other tests"
Davide Pesavento8f290fc2020-04-12 13:20:07 -040027 ./waf --color=yes configure --with-other-tests $PCH
Davide Pesavento56c68a32020-03-12 19:26:21 -040028 ./waf --color=yes build -j$WAF_JOBS
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020029
Davide Pesavento56c68a32020-03-12 19:26:21 -040030 # Cleanup
Davide Pesavento69857c32020-04-05 16:36:26 -040031 ./waf --color=yes distclean
Alexander Afanasyev6602b3b2016-03-15 14:14:11 -070032fi
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020033
Davide Pesavento56c68a32020-03-12 19:26:21 -040034# Build in debug mode with tests
Davide Pesavento8f290fc2020-04-12 13:20:07 -040035./waf --color=yes configure --debug --with-tests $ASAN $COVERAGE $PCH
Davide Pesavento56c68a32020-03-12 19:26:21 -040036./waf --color=yes build -j$WAF_JOBS
Davide Pesaventoab1e8f22014-10-21 22:45:33 +020037
Davide Pesavento56c68a32020-03-12 19:26:21 -040038# (tests will be run against the debug version)
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070039
40# Install
Davide Pesaventodda258a2018-09-06 02:43:10 -040041sudo_preserve_env PATH -- ./waf --color=yes install