Alexander Afanasyev | 4d4e725 | 2014-10-25 12:21:53 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Alexander Afanasyev | 4d4e725 | 2014-10-25 12:21:53 -0700 | [diff] [blame] | 2 | set -e |
| 3 | |
Davide Pesavento | e0edc4c | 2016-09-13 18:29:52 +0000 | [diff] [blame] | 4 | JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) |
| 5 | source "$JDIR"/util.sh |
| 6 | |
| 7 | set -x |
| 8 | |
Alexander Afanasyev | 4d4e725 | 2014-10-25 12:21:53 -0700 | [diff] [blame] | 9 | git submodule sync |
Davide Pesavento | 56c68a3 | 2020-03-12 19:26:21 -0400 | [diff] [blame^] | 10 | git submodule update --init |
Alexander Afanasyev | 4d4e725 | 2014-10-25 12:21:53 -0700 | [diff] [blame] | 11 | |
Davide Pesavento | 167040a | 2018-01-10 02:41:50 -0500 | [diff] [blame] | 12 | if [[ $JOB_NAME == *"code-coverage" ]]; then |
| 13 | COVERAGE="--with-coverage" |
| 14 | elif [[ -z $DISABLE_ASAN ]]; then |
| 15 | ASAN="--with-sanitizer=address" |
| 16 | fi |
| 17 | |
Davide Pesavento | ab1e8f2 | 2014-10-21 22:45:33 +0200 | [diff] [blame] | 18 | # Cleanup |
Davide Pesavento | dda258a | 2018-09-06 02:43:10 -0400 | [diff] [blame] | 19 | sudo_preserve_env PATH -- ./waf --color=yes distclean |
Alexander Afanasyev | 4d4e725 | 2014-10-25 12:21:53 -0700 | [diff] [blame] | 20 | |
Eric Newberry | 81a9a86 | 2016-12-27 22:59:27 -0700 | [diff] [blame] | 21 | if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then |
Davide Pesavento | 56c68a3 | 2020-03-12 19:26:21 -0400 | [diff] [blame^] | 22 | # Build in release mode with tests and without precompiled headers |
| 23 | ./waf --color=yes configure --with-tests --without-pch |
| 24 | ./waf --color=yes build -j$WAF_JOBS |
Davide Pesavento | ab1e8f2 | 2014-10-21 22:45:33 +0200 | [diff] [blame] | 25 | |
Davide Pesavento | 56c68a3 | 2020-03-12 19:26:21 -0400 | [diff] [blame^] | 26 | # Cleanup |
| 27 | sudo_preserve_env PATH -- ./waf --color=yes distclean |
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 | # Build in release mode without tests, but with "other tests" |
| 30 | ./waf --color=yes configure --with-other-tests |
| 31 | ./waf --color=yes build -j$WAF_JOBS |
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 | # Cleanup |
| 34 | sudo_preserve_env PATH -- ./waf --color=yes distclean |
Alexander Afanasyev | 6602b3b | 2016-03-15 14:14:11 -0700 | [diff] [blame] | 35 | fi |
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 | # Build in debug mode with tests |
| 38 | ./waf --color=yes configure --debug --with-tests $ASAN $COVERAGE |
| 39 | ./waf --color=yes build -j$WAF_JOBS |
Davide Pesavento | ab1e8f2 | 2014-10-21 22:45:33 +0200 | [diff] [blame] | 40 | |
Davide Pesavento | 56c68a3 | 2020-03-12 19:26:21 -0400 | [diff] [blame^] | 41 | # (tests will be run against the debug version) |
Alexander Afanasyev | 4d4e725 | 2014-10-25 12:21:53 -0700 | [diff] [blame] | 42 | |
| 43 | # Install |
Davide Pesavento | dda258a | 2018-09-06 02:43:10 -0400 | [diff] [blame] | 44 | sudo_preserve_env PATH -- ./waf --color=yes install |