blob: f5ef90a982de996270979a55aff42ae2dea6e50b [file] [log] [blame]
Davide Pesavento956ac312016-09-20 19:11:30 +02001#!/usr/bin/env bash
Davide Pesaventod8398822020-03-29 18:46:19 -04002set -ex
Davide Pesavento956ac312016-09-20 19:11:30 +02003
Davide Pesaventoa1a9d702020-03-29 00:58:15 -04004git submodule sync
5git submodule update --init
6
Davide Pesavento9a659d02018-01-10 02:55:43 -05007if [[ $JOB_NAME == *"code-coverage" ]]; then
8 COVERAGE="--with-coverage"
9elif [[ -z $DISABLE_ASAN ]]; then
10 ASAN="--with-sanitizer=address"
11fi
12
Eric Newberry9737aa82016-12-27 23:03:49 -070013if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
Davide Pesavento9fa6a782020-03-10 19:47:06 -040014 # Build in release mode with tests
15 ./waf --color=yes configure --with-tests
Davide Pesaventoa1a9d702020-03-29 00:58:15 -040016 ./waf --color=yes build -j$WAF_JOBS
Davide Pesavento956ac312016-09-20 19:11:30 +020017
Davide Pesavento9fa6a782020-03-10 19:47:06 -040018 # Cleanup
Davide Pesaventoa1a9d702020-03-29 00:58:15 -040019 ./waf --color=yes distclean
Davide Pesavento956ac312016-09-20 19:11:30 +020020
Davide Pesavento9fa6a782020-03-10 19:47:06 -040021 # Build in release mode without tests
22 ./waf --color=yes configure
Davide Pesaventoa1a9d702020-03-29 00:58:15 -040023 ./waf --color=yes build -j$WAF_JOBS
Davide Pesavento956ac312016-09-20 19:11:30 +020024
Davide Pesavento9fa6a782020-03-10 19:47:06 -040025 # Cleanup
Davide Pesaventoa1a9d702020-03-29 00:58:15 -040026 ./waf --color=yes distclean
Davide Pesavento956ac312016-09-20 19:11:30 +020027fi
28
Davide Pesavento9fa6a782020-03-10 19:47:06 -040029# Build in debug mode with tests
Davide Pesavento9a659d02018-01-10 02:55:43 -050030./waf --color=yes configure --debug --with-tests $ASAN $COVERAGE
Davide Pesaventoa1a9d702020-03-29 00:58:15 -040031./waf --color=yes build -j$WAF_JOBS
Davide Pesavento956ac312016-09-20 19:11:30 +020032
Davide Pesavento9fa6a782020-03-10 19:47:06 -040033# (tests will be run against the debug version)
Davide Pesavento956ac312016-09-20 19:11:30 +020034
35# Install
Davide Pesavento3f2f4862018-09-11 17:56:55 -040036sudo_preserve_env PATH -- ./waf --color=yes install