blob: d1db270df766c202bdef31ab44b2236a6b4e41ad [file] [log] [blame]
Davide Pesavento956ac312016-09-20 19:11:30 +02001#!/usr/bin/env bash
2set -e
3
4JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5source "$JDIR"/util.sh
6
7set -x
8
9# Cleanup
Davide Pesavento5485ca92017-08-10 21:47:42 -040010sudo env "PATH=$PATH" ./waf --color=yes distclean
Davide Pesavento956ac312016-09-20 19:11:30 +020011
Eric Newberry9737aa82016-12-27 23:03:49 -070012if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
Davide Pesavento956ac312016-09-20 19:11:30 +020013 # Configure/build in optimized mode with tests
Davide Pesavento44660cf2017-08-16 00:44:23 -040014 ./waf --color=yes configure --with-tests
15 ./waf --color=yes build -j${WAF_JOBS:-1}
Davide Pesavento956ac312016-09-20 19:11:30 +020016
17 # Cleanup
Davide Pesavento5485ca92017-08-10 21:47:42 -040018 sudo env "PATH=$PATH" ./waf --color=yes distclean
Davide Pesavento956ac312016-09-20 19:11:30 +020019
20 # Configure/build in optimized mode without tests
Davide Pesavento44660cf2017-08-16 00:44:23 -040021 ./waf --color=yes configure
22 ./waf --color=yes build -j${WAF_JOBS:-1}
Davide Pesavento956ac312016-09-20 19:11:30 +020023
24 # Cleanup
Davide Pesavento5485ca92017-08-10 21:47:42 -040025 sudo env "PATH=$PATH" ./waf --color=yes distclean
Davide Pesavento956ac312016-09-20 19:11:30 +020026fi
27
28# Configure/build in debug mode with tests
Eric Newberry9737aa82016-12-27 23:03:49 -070029if [[ $JOB_NAME == *"code-coverage" ]]; then
Eric Newberry716ab602016-12-29 21:49:57 -070030 COVERAGE="--with-coverage"
Davide Pesaventof085ed12017-06-30 14:59:52 -040031elif [[ -n $BUILD_WITH_ASAN || -z $TRAVIS ]]; then
Davide Pesavento956ac312016-09-20 19:11:30 +020032 ASAN="--with-sanitizer=address"
33fi
Davide Pesavento44660cf2017-08-16 00:44:23 -040034./waf --color=yes configure --debug --with-tests $COVERAGE $ASAN
35./waf --color=yes build -j${WAF_JOBS:-1}
Davide Pesavento956ac312016-09-20 19:11:30 +020036
37# (tests will be run against debug version)
38
39# Install
Davide Pesavento5485ca92017-08-10 21:47:42 -040040sudo env "PATH=$PATH" ./waf --color=yes install