blob: e281a7dee20e4c8c44eaf721ede95be0d5e543b3 [file] [log] [blame]
Yingdi Yu906c2ea2014-10-31 11:24:50 -07001#!/usr/bin/env bash
Yingdi Yu906c2ea2014-10-31 11:24:50 -07002set -e
3
Alexander Afanasyevf3192eb2016-12-19 17:11:20 -08004JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5source "$JDIR"/util.sh
6
7set -x
8
9git submodule init
10git submodule sync
11git submodule update
Yingdi Yu906c2ea2014-10-31 11:24:50 -070012
13# Cleanup
14sudo ./waf -j1 --color=yes distclean
15
Alexander Afanasyevf3192eb2016-12-19 17:11:20 -080016if [[ "$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 --without-pch $COVERAGE $ASAN
Yingdi Yu906c2ea2014-10-31 11:24:50 -070039./waf -j1 --color=yes build
40
Alexander Afanasyevf3192eb2016-12-19 17:11:20 -080041# (tests will be run against debug version)
Yingdi Yu906c2ea2014-10-31 11:24:50 -070042
43# Install
Alexander Afanasyevf3192eb2016-12-19 17:11:20 -080044sudo ./waf -j1 --color=yes install
45
46if has Linux $NODE_LABELS; then
47 sudo ldconfig
48elif has FreeBSD $NODE_LABELS; then
49 sudo ldconfig -a
50fi