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