blob: de9d5901a4ce63145f0a0abee2160bec478e611e [file] [log] [blame]
Yingdi Yuda495a92015-05-05 13:57:59 -07001#!/usr/bin/env bash
Yingdi Yuda495a92015-05-05 13:57:59 -07002set -e
3
Yingdi Yu2f5379b2016-03-10 12:17:58 -08004JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5source "$JDIR"/util.sh
6
Alexander Afanasyev867228e2016-10-17 16:54:55 -07007set -x
8
9git submodule init
10git submodule sync
11git submodule update
Yingdi Yuda495a92015-05-05 13:57:59 -070012
13# Cleanup
14sudo ./waf -j1 --color=yes distclean
15
Alexander Afanasyev867228e2016-10-17 16:54:55 -070016if [[ "$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
20
21 # Cleanup
22 sudo ./waf -j1 --color=yes distclean
23
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
30fi
31
32# Configure/build in debug mode with tests and without precompiled headers
33if [[ "$JOB_NAME" == *"code-coverage" ]]; then
34 COVERAGE="--with-coverage"
35elif ! has OSX-10.9 $NODE_LABELS && ! has OSX-10.11 $NODE_LABELS; then
36 ASAN="--with-sanitizer=address"
37fi
38./waf -j1 --color=yes configure --debug --with-tests $COVERAGE $ASAN
Yingdi Yuda495a92015-05-05 13:57:59 -070039./waf -j1 --color=yes build
40
Alexander Afanasyev867228e2016-10-17 16:54:55 -070041# (tests will be run against debug version)
Yingdi Yuda495a92015-05-05 13:57:59 -070042
43# Install
Alexander Afanasyev867228e2016-10-17 16:54:55 -070044sudo ./waf -j1 --color=yes install
Yingdi Yu2f5379b2016-03-10 12:17:58 -080045
46if has Linux $NODE_LABELS; then
47 sudo ldconfig
48elif has FreeBSD $NODE_LABELS; then
49 sudo ldconfig -a
50fi