Davide Pesavento | 956ac31 | 2016-09-20 19:11:30 +0200 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | set -e |
| 3 | |
| 4 | JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) |
| 5 | source "$JDIR"/util.sh |
| 6 | |
| 7 | set -x |
| 8 | |
Davide Pesavento | 9a659d0 | 2018-01-10 02:55:43 -0500 | [diff] [blame] | 9 | if [[ $JOB_NAME == *"code-coverage" ]]; then |
| 10 | COVERAGE="--with-coverage" |
| 11 | elif [[ -z $DISABLE_ASAN ]]; then |
| 12 | ASAN="--with-sanitizer=address" |
| 13 | fi |
| 14 | |
Davide Pesavento | 956ac31 | 2016-09-20 19:11:30 +0200 | [diff] [blame] | 15 | # Cleanup |
Davide Pesavento | 3f2f486 | 2018-09-11 17:56:55 -0400 | [diff] [blame] | 16 | sudo_preserve_env PATH -- ./waf --color=yes distclean |
Davide Pesavento | 956ac31 | 2016-09-20 19:11:30 +0200 | [diff] [blame] | 17 | |
Eric Newberry | 9737aa8 | 2016-12-27 23:03:49 -0700 | [diff] [blame] | 18 | if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then |
Davide Pesavento | 9fa6a78 | 2020-03-10 19:47:06 -0400 | [diff] [blame^] | 19 | # Build in release mode with tests |
| 20 | ./waf --color=yes configure --with-tests |
| 21 | ./waf --color=yes build -j${WAF_JOBS:-1} |
Davide Pesavento | 956ac31 | 2016-09-20 19:11:30 +0200 | [diff] [blame] | 22 | |
Davide Pesavento | 9fa6a78 | 2020-03-10 19:47:06 -0400 | [diff] [blame^] | 23 | # Cleanup |
| 24 | sudo_preserve_env PATH -- ./waf --color=yes distclean |
Davide Pesavento | 956ac31 | 2016-09-20 19:11:30 +0200 | [diff] [blame] | 25 | |
Davide Pesavento | 9fa6a78 | 2020-03-10 19:47:06 -0400 | [diff] [blame^] | 26 | # Build in release mode without tests |
| 27 | ./waf --color=yes configure |
| 28 | ./waf --color=yes build -j${WAF_JOBS:-1} |
Davide Pesavento | 956ac31 | 2016-09-20 19:11:30 +0200 | [diff] [blame] | 29 | |
Davide Pesavento | 9fa6a78 | 2020-03-10 19:47:06 -0400 | [diff] [blame^] | 30 | # Cleanup |
| 31 | sudo_preserve_env PATH -- ./waf --color=yes distclean |
Davide Pesavento | 956ac31 | 2016-09-20 19:11:30 +0200 | [diff] [blame] | 32 | fi |
| 33 | |
Davide Pesavento | 9fa6a78 | 2020-03-10 19:47:06 -0400 | [diff] [blame^] | 34 | # Build in debug mode with tests |
Davide Pesavento | 9a659d0 | 2018-01-10 02:55:43 -0500 | [diff] [blame] | 35 | ./waf --color=yes configure --debug --with-tests $ASAN $COVERAGE |
Davide Pesavento | 44660cf | 2017-08-16 00:44:23 -0400 | [diff] [blame] | 36 | ./waf --color=yes build -j${WAF_JOBS:-1} |
Davide Pesavento | 956ac31 | 2016-09-20 19:11:30 +0200 | [diff] [blame] | 37 | |
Davide Pesavento | 9fa6a78 | 2020-03-10 19:47:06 -0400 | [diff] [blame^] | 38 | # (tests will be run against the debug version) |
Davide Pesavento | 956ac31 | 2016-09-20 19:11:30 +0200 | [diff] [blame] | 39 | |
| 40 | # Install |
Davide Pesavento | 3f2f486 | 2018-09-11 17:56:55 -0400 | [diff] [blame] | 41 | sudo_preserve_env PATH -- ./waf --color=yes install |