blob: 2a60f0d70d7b8691535995771ca185af0e9725ea [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 Pesaventod5c24472020-04-01 17:46:18 -04007if [[ -z $DISABLE_ASAN ]]; then
8 ASAN="--with-sanitizer=address"
9fi
Davide Pesavento9a659d02018-01-10 02:55:43 -050010if [[ $JOB_NAME == *"code-coverage" ]]; then
11 COVERAGE="--with-coverage"
Davide Pesavento9a659d02018-01-10 02:55:43 -050012fi
13
Eric Newberry9737aa82016-12-27 23:03:49 -070014if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
Davide Pesavento9fa6a782020-03-10 19:47:06 -040015 # Build in release mode with tests
16 ./waf --color=yes configure --with-tests
Davide Pesaventoa1a9d702020-03-29 00:58:15 -040017 ./waf --color=yes build -j$WAF_JOBS
Davide Pesavento956ac312016-09-20 19:11:30 +020018
Davide Pesavento9fa6a782020-03-10 19:47:06 -040019 # Cleanup
Davide Pesaventoa1a9d702020-03-29 00:58:15 -040020 ./waf --color=yes distclean
Davide Pesavento956ac312016-09-20 19:11:30 +020021
Davide Pesavento9fa6a782020-03-10 19:47:06 -040022 # Build in release mode without tests
23 ./waf --color=yes configure
Davide Pesaventoa1a9d702020-03-29 00:58:15 -040024 ./waf --color=yes build -j$WAF_JOBS
Davide Pesavento956ac312016-09-20 19:11:30 +020025
Davide Pesavento9fa6a782020-03-10 19:47:06 -040026 # Cleanup
Davide Pesaventoa1a9d702020-03-29 00:58:15 -040027 ./waf --color=yes distclean
Davide Pesavento956ac312016-09-20 19:11:30 +020028fi
29
Davide Pesavento9fa6a782020-03-10 19:47:06 -040030# Build in debug mode with tests
Davide Pesavento9a659d02018-01-10 02:55:43 -050031./waf --color=yes configure --debug --with-tests $ASAN $COVERAGE
Davide Pesaventoa1a9d702020-03-29 00:58:15 -040032./waf --color=yes build -j$WAF_JOBS
Davide Pesavento956ac312016-09-20 19:11:30 +020033
Davide Pesavento9fa6a782020-03-10 19:47:06 -040034# (tests will be run against the debug version)
Davide Pesavento956ac312016-09-20 19:11:30 +020035
36# Install
Davide Pesavento3f2f4862018-09-11 17:56:55 -040037sudo_preserve_env PATH -- ./waf --color=yes install