blob: 199ed203822859b49ca6ddd901302b78b5873d90 [file] [log] [blame]
Davide Pesavento956ac312016-09-20 19:11:30 +02001#!/usr/bin/env bash
Davide Pesaventobd3642f2022-08-12 18:19:31 -04002set -eo pipefail
Davide Pesaventoa1a9d702020-03-29 00:58:15 -04003
Davide Pesaventod5c24472020-04-01 17:46:18 -04004if [[ -z $DISABLE_ASAN ]]; then
5 ASAN="--with-sanitizer=address"
6fi
Davide Pesavento9a659d02018-01-10 02:55:43 -05007if [[ $JOB_NAME == *"code-coverage" ]]; then
8 COVERAGE="--with-coverage"
Davide Pesavento9a659d02018-01-10 02:55:43 -05009fi
10
Davide Pesaventobd3642f2022-08-12 18:19:31 -040011set -x
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 Pesaventobd3642f2022-08-12 18:19:31 -040016 ./waf --color=yes build
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 Pesaventobd3642f2022-08-12 18:19:31 -040023 ./waf --color=yes build
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 Pesaventobd3642f2022-08-12 18:19:31 -040031./waf --color=yes build
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 Pesaventobd3642f2022-08-12 18:19:31 -040036sudo ./waf --color=yes install