Alexander Afanasyev | bc98fcf | 2014-08-16 23:18:50 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Vince Lehman | 0a7da61 | 2014-10-29 14:39:29 -0500 | [diff] [blame] | 2 | set -e |
Alexander Afanasyev | bc98fcf | 2014-08-16 23:18:50 -0700 | [diff] [blame] | 3 | |
Davide Pesavento | 6a81b77 | 2017-08-20 18:43:46 -0400 | [diff] [blame] | 4 | JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) |
| 5 | source "$JDIR"/util.sh |
| 6 | |
| 7 | set -x |
| 8 | |
Alexander Afanasyev | bc98fcf | 2014-08-16 23:18:50 -0700 | [diff] [blame] | 9 | git submodule init |
| 10 | git submodule sync |
| 11 | git submodule update |
| 12 | |
Vince Lehman | 0a7da61 | 2014-10-29 14:39:29 -0500 | [diff] [blame] | 13 | # Cleanup |
Davide Pesavento | 6a81b77 | 2017-08-20 18:43:46 -0400 | [diff] [blame] | 14 | sudo env "PATH=$PATH" ./waf --color=yes distclean |
Alexander Afanasyev | bc98fcf | 2014-08-16 23:18:50 -0700 | [diff] [blame] | 15 | |
Vince Lehman | 0a7da61 | 2014-10-29 14:39:29 -0500 | [diff] [blame] | 16 | # Configure/build in debug mode |
| 17 | ./waf -j1 --color=yes configure --with-tests --debug |
| 18 | ./waf -j1 --color=yes build |
| 19 | |
| 20 | # Cleanup |
Davide Pesavento | 6a81b77 | 2017-08-20 18:43:46 -0400 | [diff] [blame] | 21 | sudo env "PATH=$PATH" ./waf --color=yes distclean |
Vince Lehman | 0a7da61 | 2014-10-29 14:39:29 -0500 | [diff] [blame] | 22 | |
| 23 | # Configure/build in optimized mode without tests |
| 24 | ./waf -j1 --color=yes configure |
| 25 | ./waf -j1 --color=yes build |
| 26 | |
| 27 | # Cleanup |
Davide Pesavento | 6a81b77 | 2017-08-20 18:43:46 -0400 | [diff] [blame] | 28 | sudo env "PATH=$PATH" ./waf --color=yes distclean |
Vince Lehman | 0a7da61 | 2014-10-29 14:39:29 -0500 | [diff] [blame] | 29 | |
Davide Pesavento | c58cc7f | 2017-08-08 16:51:28 -0500 | [diff] [blame] | 30 | if [[ $JOB_NAME == *"code-coverage" ]]; then |
| 31 | COVERAGE="--with-coverage" |
| 32 | elif [[ -n $BUILD_WITH_ASAN || -z $TRAVIS ]]; then |
| 33 | ASAN="--with-sanitizer=address" |
| 34 | fi |
| 35 | |
Vince Lehman | 0a7da61 | 2014-10-29 14:39:29 -0500 | [diff] [blame] | 36 | # Configure/build in optimized mode with tests |
Davide Pesavento | c58cc7f | 2017-08-08 16:51:28 -0500 | [diff] [blame] | 37 | ./waf -j1 --color=yes configure --with-tests $COVERAGE $ASAN |
Vince Lehman | 0a7da61 | 2014-10-29 14:39:29 -0500 | [diff] [blame] | 38 | ./waf -j1 --color=yes build |
| 39 | |
| 40 | # (tests will be run against optimized version) |
| 41 | |
Davide Pesavento | 6a81b77 | 2017-08-20 18:43:46 -0400 | [diff] [blame] | 42 | # Install |
| 43 | sudo env "PATH=$PATH" ./waf --color=yes install |