blob: 5748dc4fc8c4c0efcb0f1a763aa3c72473a666ca [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
Davide Pesavento9a659d02018-01-10 02:55:43 -05009if [[ $JOB_NAME == *"code-coverage" ]]; then
10 COVERAGE="--with-coverage"
11elif [[ -z $DISABLE_ASAN ]]; then
12 ASAN="--with-sanitizer=address"
13fi
14
Davide Pesavento956ac312016-09-20 19:11:30 +020015# Cleanup
Davide Pesavento3f2f4862018-09-11 17:56:55 -040016sudo_preserve_env PATH -- ./waf --color=yes distclean
Davide Pesavento956ac312016-09-20 19:11:30 +020017
Eric Newberry9737aa82016-12-27 23:03:49 -070018if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
Davide Pesavento9fa6a782020-03-10 19:47:06 -040019 # Build in release mode with tests
20 ./waf --color=yes configure --with-tests
21 ./waf --color=yes build -j${WAF_JOBS:-1}
Davide Pesavento956ac312016-09-20 19:11:30 +020022
Davide Pesavento9fa6a782020-03-10 19:47:06 -040023 # Cleanup
24 sudo_preserve_env PATH -- ./waf --color=yes distclean
Davide Pesavento956ac312016-09-20 19:11:30 +020025
Davide Pesavento9fa6a782020-03-10 19:47:06 -040026 # Build in release mode without tests
27 ./waf --color=yes configure
28 ./waf --color=yes build -j${WAF_JOBS:-1}
Davide Pesavento956ac312016-09-20 19:11:30 +020029
Davide Pesavento9fa6a782020-03-10 19:47:06 -040030 # Cleanup
31 sudo_preserve_env PATH -- ./waf --color=yes distclean
Davide Pesavento956ac312016-09-20 19:11:30 +020032fi
33
Davide Pesavento9fa6a782020-03-10 19:47:06 -040034# Build in debug mode with tests
Davide Pesavento9a659d02018-01-10 02:55:43 -050035./waf --color=yes configure --debug --with-tests $ASAN $COVERAGE
Davide Pesavento44660cf2017-08-16 00:44:23 -040036./waf --color=yes build -j${WAF_JOBS:-1}
Davide Pesavento956ac312016-09-20 19:11:30 +020037
Davide Pesavento9fa6a782020-03-10 19:47:06 -040038# (tests will be run against the debug version)
Davide Pesavento956ac312016-09-20 19:11:30 +020039
40# Install
Davide Pesavento3f2f4862018-09-11 17:56:55 -040041sudo_preserve_env PATH -- ./waf --color=yes install