blob: a3c171e176c2860751ae959f7fc51eec272b7f67 [file] [log] [blame]
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -07001#!/usr/bin/env bash
Vince Lehman0a7da612014-10-29 14:39:29 -05002set -e
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -07003
Davide Pesavento6a81b772017-08-20 18:43:46 -04004JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5source "$JDIR"/util.sh
6
7set -x
8
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -07009git submodule init
10git submodule sync
11git submodule update
12
Vince Lehman0a7da612014-10-29 14:39:29 -050013# Cleanup
Davide Pesavento6a81b772017-08-20 18:43:46 -040014sudo env "PATH=$PATH" ./waf --color=yes distclean
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -070015
Vince Lehman0a7da612014-10-29 14:39:29 -050016# Configure/build in debug mode
17./waf -j1 --color=yes configure --with-tests --debug
18./waf -j1 --color=yes build
19
20# Cleanup
Davide Pesavento6a81b772017-08-20 18:43:46 -040021sudo env "PATH=$PATH" ./waf --color=yes distclean
Vince Lehman0a7da612014-10-29 14:39:29 -050022
23# Configure/build in optimized mode without tests
24./waf -j1 --color=yes configure
25./waf -j1 --color=yes build
26
27# Cleanup
Davide Pesavento6a81b772017-08-20 18:43:46 -040028sudo env "PATH=$PATH" ./waf --color=yes distclean
Vince Lehman0a7da612014-10-29 14:39:29 -050029
Davide Pesaventoc58cc7f2017-08-08 16:51:28 -050030if [[ $JOB_NAME == *"code-coverage" ]]; then
31 COVERAGE="--with-coverage"
32elif [[ -n $BUILD_WITH_ASAN || -z $TRAVIS ]]; then
33 ASAN="--with-sanitizer=address"
34fi
35
Vince Lehman0a7da612014-10-29 14:39:29 -050036# Configure/build in optimized mode with tests
Davide Pesaventoc58cc7f2017-08-08 16:51:28 -050037./waf -j1 --color=yes configure --with-tests $COVERAGE $ASAN
Vince Lehman0a7da612014-10-29 14:39:29 -050038./waf -j1 --color=yes build
39
40# (tests will be run against optimized version)
41
Davide Pesavento6a81b772017-08-20 18:43:46 -040042# Install
43sudo env "PATH=$PATH" ./waf --color=yes install