Alexander Afanasyev | 21034bf | 2014-09-02 18:31:53 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Shock Jiang | 2d8483c | 2014-10-30 10:15:37 -0700 | [diff] [blame] | 2 | set -e |
Alexander Afanasyev | 21034bf | 2014-09-02 18:31:53 -0700 | [diff] [blame] | 3 | |
Alexander Afanasyev | c7c9900 | 2015-10-09 17:27:30 -0700 | [diff] [blame] | 4 | JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) |
| 5 | source "$JDIR"/util.sh |
Alexander Afanasyev | 7495a7e | 2014-11-20 19:21:27 -0800 | [diff] [blame] | 6 | |
Alexander Afanasyev | 984ca9d | 2016-12-19 13:09:14 -0800 | [diff] [blame^] | 7 | set -x |
Alexander Afanasyev | 7495a7e | 2014-11-20 19:21:27 -0800 | [diff] [blame] | 8 | |
Alexander Afanasyev | 984ca9d | 2016-12-19 13:09:14 -0800 | [diff] [blame^] | 9 | git submodule init |
| 10 | git submodule sync |
| 11 | git submodule update |
Alexander Afanasyev | 7495a7e | 2014-11-20 19:21:27 -0800 | [diff] [blame] | 12 | |
| 13 | # Cleanup |
| 14 | sudo ./waf -j1 --color=yes distclean |
| 15 | |
Alexander Afanasyev | 984ca9d | 2016-12-19 13:09:14 -0800 | [diff] [blame^] | 16 | if [[ "$JOB_NAME" != *"limited-build" ]]; then |
| 17 | # Configure/build in optimized mode with tests |
| 18 | ./waf -j1 --color=yes configure --with-tests |
| 19 | ./waf -j1 --color=yes build |
Alexander Afanasyev | 7495a7e | 2014-11-20 19:21:27 -0800 | [diff] [blame] | 20 | |
Alexander Afanasyev | 984ca9d | 2016-12-19 13:09:14 -0800 | [diff] [blame^] | 21 | # Cleanup |
| 22 | sudo ./waf -j1 --color=yes distclean |
Alexander Afanasyev | 7495a7e | 2014-11-20 19:21:27 -0800 | [diff] [blame] | 23 | |
Alexander Afanasyev | 984ca9d | 2016-12-19 13:09:14 -0800 | [diff] [blame^] | 24 | # Configure/build in optimized mode without tests |
| 25 | ./waf -j1 --color=yes configure |
| 26 | ./waf -j1 --color=yes build |
| 27 | |
| 28 | # Cleanup |
| 29 | sudo ./waf -j1 --color=yes distclean |
| 30 | fi |
| 31 | |
| 32 | # Configure/build in debug mode with tests |
Alexander Afanasyev | c7c9900 | 2015-10-09 17:27:30 -0700 | [diff] [blame] | 33 | if [[ "$JOB_NAME" == *"code-coverage" ]]; then |
| 34 | COVERAGE="--with-coverage" |
Alexander Afanasyev | 984ca9d | 2016-12-19 13:09:14 -0800 | [diff] [blame^] | 35 | elif ! has OSX-10.9 $NODE_LABELS && ! has OSX-10.11 $NODE_LABELS; then |
| 36 | ASAN="--with-sanitizer=address" |
Alexander Afanasyev | c7c9900 | 2015-10-09 17:27:30 -0700 | [diff] [blame] | 37 | fi |
Alexander Afanasyev | 984ca9d | 2016-12-19 13:09:14 -0800 | [diff] [blame^] | 38 | ./waf -j1 --color=yes configure --debug --with-tests $COVERAGE $ASAN |
Alexander Afanasyev | 7495a7e | 2014-11-20 19:21:27 -0800 | [diff] [blame] | 39 | ./waf -j1 --color=yes build |
| 40 | |
Alexander Afanasyev | c7c9900 | 2015-10-09 17:27:30 -0700 | [diff] [blame] | 41 | # (tests will be run against debug version) |
Alexander Afanasyev | 7495a7e | 2014-11-20 19:21:27 -0800 | [diff] [blame] | 42 | |
| 43 | # Install |
| 44 | sudo ./waf -j1 --color=yes install |