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 | |
| 9 | # Cleanup |
Davide Pesavento | 5485ca9 | 2017-08-10 21:47:42 -0400 | [diff] [blame] | 10 | sudo env "PATH=$PATH" ./waf --color=yes distclean |
Davide Pesavento | 956ac31 | 2016-09-20 19:11:30 +0200 | [diff] [blame] | 11 | |
Eric Newberry | 9737aa8 | 2016-12-27 23:03:49 -0700 | [diff] [blame] | 12 | if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then |
Davide Pesavento | 956ac31 | 2016-09-20 19:11:30 +0200 | [diff] [blame] | 13 | # Configure/build in optimized mode with tests |
Davide Pesavento | 44660cf | 2017-08-16 00:44:23 -0400 | [diff] [blame] | 14 | ./waf --color=yes configure --with-tests |
| 15 | ./waf --color=yes build -j${WAF_JOBS:-1} |
Davide Pesavento | 956ac31 | 2016-09-20 19:11:30 +0200 | [diff] [blame] | 16 | |
| 17 | # Cleanup |
Davide Pesavento | 5485ca9 | 2017-08-10 21:47:42 -0400 | [diff] [blame] | 18 | sudo env "PATH=$PATH" ./waf --color=yes distclean |
Davide Pesavento | 956ac31 | 2016-09-20 19:11:30 +0200 | [diff] [blame] | 19 | |
| 20 | # Configure/build in optimized mode without tests |
Davide Pesavento | 44660cf | 2017-08-16 00:44:23 -0400 | [diff] [blame] | 21 | ./waf --color=yes configure |
| 22 | ./waf --color=yes build -j${WAF_JOBS:-1} |
Davide Pesavento | 956ac31 | 2016-09-20 19:11:30 +0200 | [diff] [blame] | 23 | |
| 24 | # Cleanup |
Davide Pesavento | 5485ca9 | 2017-08-10 21:47:42 -0400 | [diff] [blame] | 25 | sudo env "PATH=$PATH" ./waf --color=yes distclean |
Davide Pesavento | 956ac31 | 2016-09-20 19:11:30 +0200 | [diff] [blame] | 26 | fi |
| 27 | |
| 28 | # Configure/build in debug mode with tests |
Eric Newberry | 9737aa8 | 2016-12-27 23:03:49 -0700 | [diff] [blame] | 29 | if [[ $JOB_NAME == *"code-coverage" ]]; then |
Eric Newberry | 716ab60 | 2016-12-29 21:49:57 -0700 | [diff] [blame] | 30 | COVERAGE="--with-coverage" |
Davide Pesavento | f085ed1 | 2017-06-30 14:59:52 -0400 | [diff] [blame] | 31 | elif [[ -n $BUILD_WITH_ASAN || -z $TRAVIS ]]; then |
Davide Pesavento | 956ac31 | 2016-09-20 19:11:30 +0200 | [diff] [blame] | 32 | ASAN="--with-sanitizer=address" |
| 33 | fi |
Davide Pesavento | 44660cf | 2017-08-16 00:44:23 -0400 | [diff] [blame] | 34 | ./waf --color=yes configure --debug --with-tests $COVERAGE $ASAN |
| 35 | ./waf --color=yes build -j${WAF_JOBS:-1} |
Davide Pesavento | 956ac31 | 2016-09-20 19:11:30 +0200 | [diff] [blame] | 36 | |
| 37 | # (tests will be run against debug version) |
| 38 | |
| 39 | # Install |
Davide Pesavento | 5485ca9 | 2017-08-10 21:47:42 -0400 | [diff] [blame] | 40 | sudo env "PATH=$PATH" ./waf --color=yes install |