Davide Pesavento | 813df80 | 2017-08-20 20:53:54 -0400 | [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 | git submodule init |
| 10 | git submodule sync |
| 11 | git submodule update |
| 12 | |
Davide Pesavento | 437adfe | 2018-01-11 02:20:42 -0500 | [diff] [blame] | 13 | if [[ $JOB_NAME == *"code-coverage" ]]; then |
| 14 | COVERAGE="--with-coverage" |
| 15 | elif [[ -z $DISABLE_ASAN ]]; then |
| 16 | ASAN="--with-sanitizer=address" |
| 17 | fi |
| 18 | |
Davide Pesavento | 813df80 | 2017-08-20 20:53:54 -0400 | [diff] [blame] | 19 | # Cleanup |
Davide Pesavento | 0b0eddd | 2019-03-19 14:42:15 -0400 | [diff] [blame] | 20 | sudo_preserve_env PATH -- ./waf --color=yes distclean |
Davide Pesavento | 813df80 | 2017-08-20 20:53:54 -0400 | [diff] [blame] | 21 | |
| 22 | if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then |
Davide Pesavento | 6ebfd7c | 2017-08-26 17:52:54 -0400 | [diff] [blame] | 23 | # Configure/build in optimized mode with tests |
| 24 | ./waf --color=yes configure --with-tests |
Davide Pesavento | 813df80 | 2017-08-20 20:53:54 -0400 | [diff] [blame] | 25 | ./waf --color=yes build -j${WAF_JOBS:-1} |
| 26 | |
| 27 | # Cleanup |
Davide Pesavento | 0b0eddd | 2019-03-19 14:42:15 -0400 | [diff] [blame] | 28 | sudo_preserve_env PATH -- ./waf --color=yes distclean |
Davide Pesavento | 813df80 | 2017-08-20 20:53:54 -0400 | [diff] [blame] | 29 | |
| 30 | # Configure/build in optimized mode without tests |
| 31 | ./waf --color=yes configure |
| 32 | ./waf --color=yes build -j${WAF_JOBS:-1} |
| 33 | |
| 34 | # Cleanup |
Davide Pesavento | 0b0eddd | 2019-03-19 14:42:15 -0400 | [diff] [blame] | 35 | sudo_preserve_env PATH -- ./waf --color=yes distclean |
Davide Pesavento | 813df80 | 2017-08-20 20:53:54 -0400 | [diff] [blame] | 36 | fi |
| 37 | |
Davide Pesavento | 6ebfd7c | 2017-08-26 17:52:54 -0400 | [diff] [blame] | 38 | # Configure/build in debug mode with tests |
Davide Pesavento | 437adfe | 2018-01-11 02:20:42 -0500 | [diff] [blame] | 39 | ./waf --color=yes configure --debug --with-tests $ASAN $COVERAGE |
Davide Pesavento | 813df80 | 2017-08-20 20:53:54 -0400 | [diff] [blame] | 40 | ./waf --color=yes build -j${WAF_JOBS:-1} |
| 41 | |
Davide Pesavento | 6ebfd7c | 2017-08-26 17:52:54 -0400 | [diff] [blame] | 42 | # (tests will be run against debug version) |
Davide Pesavento | 813df80 | 2017-08-20 20:53:54 -0400 | [diff] [blame] | 43 | |
| 44 | # Install |
Davide Pesavento | 0b0eddd | 2019-03-19 14:42:15 -0400 | [diff] [blame] | 45 | sudo_preserve_env PATH -- ./waf --color=yes install |