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 | |
| 13 | # Cleanup |
| 14 | sudo env "PATH=$PATH" ./waf --color=yes distclean |
| 15 | |
| 16 | if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then |
| 17 | # Configure/build in debug mode with tests |
| 18 | ./waf --color=yes configure --with-tests --debug |
| 19 | ./waf --color=yes build -j${WAF_JOBS:-1} |
| 20 | |
| 21 | # Cleanup |
| 22 | sudo env "PATH=$PATH" ./waf --color=yes distclean |
| 23 | |
| 24 | # Configure/build in optimized mode without tests |
| 25 | ./waf --color=yes configure |
| 26 | ./waf --color=yes build -j${WAF_JOBS:-1} |
| 27 | |
| 28 | # Cleanup |
| 29 | sudo env "PATH=$PATH" ./waf --color=yes distclean |
| 30 | fi |
| 31 | |
| 32 | # Configure/build in optimized mode with tests |
| 33 | if [[ $JOB_NAME == *"code-coverage" ]]; then |
| 34 | COVERAGE="--with-coverage" |
| 35 | elif [[ -n $BUILD_WITH_ASAN || -z $TRAVIS ]]; then |
| 36 | ASAN="--with-sanitizer=address" |
| 37 | fi |
| 38 | ./waf --color=yes configure --with-tests $COVERAGE $ASAN |
| 39 | ./waf --color=yes build -j${WAF_JOBS:-1} |
| 40 | |
| 41 | # (tests will be run against optimized version) |
| 42 | |
| 43 | # Install |
| 44 | sudo env "PATH=$PATH" ./waf --color=yes install |