blob: ccbcc93839d4820158b96df02bd0b653f64d97a6 [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 Pesaventoa1a9d702020-03-29 00:58:15 -04009git submodule sync
10git submodule update --init
11
Davide Pesavento9a659d02018-01-10 02:55:43 -050012if [[ $JOB_NAME == *"code-coverage" ]]; then
13 COVERAGE="--with-coverage"
14elif [[ -z $DISABLE_ASAN ]]; then
15 ASAN="--with-sanitizer=address"
16fi
17
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
Davide Pesaventoa1a9d702020-03-29 00:58:15 -040021 ./waf --color=yes build -j$WAF_JOBS
Davide Pesavento956ac312016-09-20 19:11:30 +020022
Davide Pesavento9fa6a782020-03-10 19:47:06 -040023 # Cleanup
Davide Pesaventoa1a9d702020-03-29 00:58:15 -040024 ./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
Davide Pesaventoa1a9d702020-03-29 00:58:15 -040028 ./waf --color=yes build -j$WAF_JOBS
Davide Pesavento956ac312016-09-20 19:11:30 +020029
Davide Pesavento9fa6a782020-03-10 19:47:06 -040030 # Cleanup
Davide Pesaventoa1a9d702020-03-29 00:58:15 -040031 ./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 Pesaventoa1a9d702020-03-29 00:58:15 -040036./waf --color=yes build -j$WAF_JOBS
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