blob: 6faaf559cd294f892b45348cab5ab9a3cf8797c3 [file] [log] [blame]
Davide Pesavento813df802017-08-20 20:53:54 -04001#!/usr/bin/env bash
2set -e
3
4JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5source "$JDIR"/util.sh
6
7set -x
8
9git submodule init
10git submodule sync
11git submodule update
12
Davide Pesavento437adfe2018-01-11 02:20:42 -050013if [[ $JOB_NAME == *"code-coverage" ]]; then
14 COVERAGE="--with-coverage"
15elif [[ -z $DISABLE_ASAN ]]; then
16 ASAN="--with-sanitizer=address"
17fi
18
Davide Pesavento813df802017-08-20 20:53:54 -040019# Cleanup
Davide Pesavento0b0eddd2019-03-19 14:42:15 -040020sudo_preserve_env PATH -- ./waf --color=yes distclean
Davide Pesavento813df802017-08-20 20:53:54 -040021
22if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
Davide Pesavento6ebfd7c2017-08-26 17:52:54 -040023 # Configure/build in optimized mode with tests
24 ./waf --color=yes configure --with-tests
Davide Pesavento813df802017-08-20 20:53:54 -040025 ./waf --color=yes build -j${WAF_JOBS:-1}
26
27 # Cleanup
Davide Pesavento0b0eddd2019-03-19 14:42:15 -040028 sudo_preserve_env PATH -- ./waf --color=yes distclean
Davide Pesavento813df802017-08-20 20:53:54 -040029
30 # Configure/build in optimized mode without tests
31 ./waf --color=yes configure
32 ./waf --color=yes build -j${WAF_JOBS:-1}
33
34 # Cleanup
Davide Pesavento0b0eddd2019-03-19 14:42:15 -040035 sudo_preserve_env PATH -- ./waf --color=yes distclean
Davide Pesavento813df802017-08-20 20:53:54 -040036fi
37
Davide Pesavento6ebfd7c2017-08-26 17:52:54 -040038# Configure/build in debug mode with tests
Davide Pesavento437adfe2018-01-11 02:20:42 -050039./waf --color=yes configure --debug --with-tests $ASAN $COVERAGE
Davide Pesavento813df802017-08-20 20:53:54 -040040./waf --color=yes build -j${WAF_JOBS:-1}
41
Davide Pesavento6ebfd7c2017-08-26 17:52:54 -040042# (tests will be run against debug version)
Davide Pesavento813df802017-08-20 20:53:54 -040043
44# Install
Davide Pesavento0b0eddd2019-03-19 14:42:15 -040045sudo_preserve_env PATH -- ./waf --color=yes install