Ashlesh Gawande | 0b2897e | 2018-06-20 14:40:47 -0500 | [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 | 1526fee | 2019-03-18 19:31:55 -0400 | [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 | |
Ashlesh Gawande | 0b2897e | 2018-06-20 14:40:47 -0500 | [diff] [blame] | 15 | # Cleanup |
Davide Pesavento | 1526fee | 2019-03-18 19:31:55 -0400 | [diff] [blame^] | 16 | sudo_preserve_env PATH -- ./waf --color=yes distclean |
Ashlesh Gawande | 0b2897e | 2018-06-20 14:40:47 -0500 | [diff] [blame] | 17 | |
| 18 | if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then |
| 19 | # Configure/build in optimized mode with tests |
| 20 | ./waf --color=yes configure --with-tests |
| 21 | ./waf --color=yes build -j${WAF_JOBS:-1} |
| 22 | |
| 23 | # Cleanup |
Davide Pesavento | 1526fee | 2019-03-18 19:31:55 -0400 | [diff] [blame^] | 24 | sudo_preserve_env PATH -- ./waf --color=yes distclean |
Ashlesh Gawande | 0b2897e | 2018-06-20 14:40:47 -0500 | [diff] [blame] | 25 | |
| 26 | # Configure/build in optimized mode without tests |
| 27 | ./waf --color=yes configure |
| 28 | ./waf --color=yes build -j${WAF_JOBS:-1} |
| 29 | |
| 30 | # Cleanup |
Davide Pesavento | 1526fee | 2019-03-18 19:31:55 -0400 | [diff] [blame^] | 31 | sudo_preserve_env PATH -- ./waf --color=yes distclean |
Ashlesh Gawande | 0b2897e | 2018-06-20 14:40:47 -0500 | [diff] [blame] | 32 | fi |
| 33 | |
| 34 | # Configure/build in debug mode with tests |
Davide Pesavento | 1526fee | 2019-03-18 19:31:55 -0400 | [diff] [blame^] | 35 | ./waf --color=yes configure --debug --with-tests --with-examples $ASAN $COVERAGE |
Ashlesh Gawande | 0b2897e | 2018-06-20 14:40:47 -0500 | [diff] [blame] | 36 | ./waf --color=yes build -j${WAF_JOBS:-1} |
| 37 | |
| 38 | # (tests will be run against debug version) |
| 39 | |
| 40 | # Install |
Davide Pesavento | 1526fee | 2019-03-18 19:31:55 -0400 | [diff] [blame^] | 41 | sudo_preserve_env PATH -- ./waf --color=yes install |
Ashlesh Gawande | 0b2897e | 2018-06-20 14:40:47 -0500 | [diff] [blame] | 42 | |
| 43 | if has Linux $NODE_LABELS; then |
| 44 | sudo ldconfig |
| 45 | elif has FreeBSD $NODE_LABELS; then |
| 46 | sudo ldconfig -a |
| 47 | fi |