Alexander Afanasyev | 4d4e725 | 2014-10-25 12:21:53 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 2 | set -ex |
Davide Pesavento | e0edc4c | 2016-09-13 18:29:52 +0000 | [diff] [blame] | 3 | |
Alexander Afanasyev | 4d4e725 | 2014-10-25 12:21:53 -0700 | [diff] [blame] | 4 | git submodule sync |
Davide Pesavento | 56c68a3 | 2020-03-12 19:26:21 -0400 | [diff] [blame] | 5 | git submodule update --init |
Alexander Afanasyev | 4d4e725 | 2014-10-25 12:21:53 -0700 | [diff] [blame] | 6 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 7 | if [[ -z $DISABLE_ASAN ]]; then |
Davide Pesavento | 167040a | 2018-01-10 02:41:50 -0500 | [diff] [blame] | 8 | ASAN="--with-sanitizer=address" |
| 9 | fi |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 10 | if [[ $JOB_NAME == *"code-coverage" ]]; then |
| 11 | COVERAGE="--with-coverage" |
| 12 | fi |
Davide Pesavento | 2150da8 | 2022-07-08 18:18:51 -0400 | [diff] [blame] | 13 | if [[ -n $DISABLE_PCH ]]; then |
Davide Pesavento | 8f290fc | 2020-04-12 13:20:07 -0400 | [diff] [blame] | 14 | PCH="--without-pch" |
| 15 | fi |
Alexander Afanasyev | 4d4e725 | 2014-10-25 12:21:53 -0700 | [diff] [blame] | 16 | |
Eric Newberry | 81a9a86 | 2016-12-27 22:59:27 -0700 | [diff] [blame] | 17 | if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then |
Davide Pesavento | 56c68a3 | 2020-03-12 19:26:21 -0400 | [diff] [blame] | 18 | # 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 Pesavento | ab1e8f2 | 2014-10-21 22:45:33 +0200 | [diff] [blame] | 21 | |
Davide Pesavento | 56c68a3 | 2020-03-12 19:26:21 -0400 | [diff] [blame] | 22 | # Cleanup |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 23 | ./waf --color=yes distclean |
Davide Pesavento | ab1e8f2 | 2014-10-21 22:45:33 +0200 | [diff] [blame] | 24 | |
Davide Pesavento | 56c68a3 | 2020-03-12 19:26:21 -0400 | [diff] [blame] | 25 | # Build in release mode without tests, but with "other tests" |
Davide Pesavento | 8f290fc | 2020-04-12 13:20:07 -0400 | [diff] [blame] | 26 | ./waf --color=yes configure --with-other-tests $PCH |
Davide Pesavento | 56c68a3 | 2020-03-12 19:26:21 -0400 | [diff] [blame] | 27 | ./waf --color=yes build -j$WAF_JOBS |
Davide Pesavento | ab1e8f2 | 2014-10-21 22:45:33 +0200 | [diff] [blame] | 28 | |
Davide Pesavento | 56c68a3 | 2020-03-12 19:26:21 -0400 | [diff] [blame] | 29 | # Cleanup |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 30 | ./waf --color=yes distclean |
Alexander Afanasyev | 6602b3b | 2016-03-15 14:14:11 -0700 | [diff] [blame] | 31 | fi |
Davide Pesavento | ab1e8f2 | 2014-10-21 22:45:33 +0200 | [diff] [blame] | 32 | |
Davide Pesavento | 56c68a3 | 2020-03-12 19:26:21 -0400 | [diff] [blame] | 33 | # Build in debug mode with tests |
Davide Pesavento | 8f290fc | 2020-04-12 13:20:07 -0400 | [diff] [blame] | 34 | ./waf --color=yes configure --debug --with-tests $ASAN $COVERAGE $PCH |
Davide Pesavento | 56c68a3 | 2020-03-12 19:26:21 -0400 | [diff] [blame] | 35 | ./waf --color=yes build -j$WAF_JOBS |
Davide Pesavento | ab1e8f2 | 2014-10-21 22:45:33 +0200 | [diff] [blame] | 36 | |
Davide Pesavento | 56c68a3 | 2020-03-12 19:26:21 -0400 | [diff] [blame] | 37 | # (tests will be run against the debug version) |
Alexander Afanasyev | 4d4e725 | 2014-10-25 12:21:53 -0700 | [diff] [blame] | 38 | |
| 39 | # Install |
Davide Pesavento | dda258a | 2018-09-06 02:43:10 -0400 | [diff] [blame] | 40 | sudo_preserve_env PATH -- ./waf --color=yes install |