Alexander Afanasyev | f34a355 | 2017-08-13 21:17:05 -0400 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Davide Pesavento | 4a16004 | 2020-04-13 16:50:02 -0400 | [diff] [blame] | 2 | set -ex |
Alexander Afanasyev | f34a355 | 2017-08-13 21:17:05 -0400 | [diff] [blame] | 3 | |
Alexander Afanasyev | f34a355 | 2017-08-13 21:17:05 -0400 | [diff] [blame] | 4 | git submodule sync |
Davide Pesavento | 4a16004 | 2020-04-13 16:50:02 -0400 | [diff] [blame] | 5 | git submodule update --init |
Alexander Afanasyev | f34a355 | 2017-08-13 21:17:05 -0400 | [diff] [blame] | 6 | |
Davide Pesavento | 4a16004 | 2020-04-13 16:50:02 -0400 | [diff] [blame] | 7 | if [[ -z $DISABLE_ASAN ]]; then |
Alexander Afanasyev | f34a355 | 2017-08-13 21:17:05 -0400 | [diff] [blame] | 8 | ASAN="--with-sanitizer=address" |
| 9 | fi |
Davide Pesavento | 4a16004 | 2020-04-13 16:50:02 -0400 | [diff] [blame] | 10 | if [[ $JOB_NAME == *"code-coverage" ]]; then |
| 11 | COVERAGE="--with-coverage" |
| 12 | fi |
Alexander Afanasyev | f34a355 | 2017-08-13 21:17:05 -0400 | [diff] [blame] | 13 | |
Davide Pesavento | 4a16004 | 2020-04-13 16:50:02 -0400 | [diff] [blame] | 14 | if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then |
| 15 | # Build in release mode with tests |
| 16 | ./waf --color=yes configure --with-tests |
| 17 | ./waf --color=yes build -j$WAF_JOBS |
| 18 | |
| 19 | # Cleanup |
| 20 | ./waf --color=yes distclean |
| 21 | |
| 22 | # Build in release mode without tests |
| 23 | ./waf --color=yes configure |
| 24 | ./waf --color=yes build -j$WAF_JOBS |
| 25 | |
| 26 | # Cleanup |
| 27 | ./waf --color=yes distclean |
| 28 | fi |
| 29 | |
| 30 | # Build in debug mode with tests and examples |
| 31 | ./waf --color=yes configure --debug --with-tests --with-examples $ASAN $COVERAGE |
| 32 | ./waf --color=yes build -j$WAF_JOBS |
| 33 | |
| 34 | # (tests will be run against the debug version) |
Alexander Afanasyev | f34a355 | 2017-08-13 21:17:05 -0400 | [diff] [blame] | 35 | |
| 36 | # Install |
Davide Pesavento | 4a16004 | 2020-04-13 16:50:02 -0400 | [diff] [blame] | 37 | sudo_preserve_env PATH -- ./waf --color=yes install |