blob: 20e6bd17736e6e829d0a84b085f502501577db69 [file] [log] [blame]
Zhiyi Zhang8617a792017-01-17 16:45:56 -08001#!/usr/bin/env bash
Davide Pesavento552174c2020-04-16 01:54:08 -04002set -ex
Zhiyi Zhang8617a792017-01-17 16:45:56 -08003
Davide Pesavento552174c2020-04-16 01:54:08 -04004git submodule sync
5git submodule update --init
Zhiyi Zhang8617a792017-01-17 16:45:56 -08006
Davide Pesavento552174c2020-04-16 01:54:08 -04007if [[ -z $DISABLE_ASAN ]]; then
Davide Pesaventocf9ffe42018-01-21 22:21:53 -05008 ASAN="--with-sanitizer=address"
9fi
Davide Pesavento552174c2020-04-16 01:54:08 -040010if [[ $JOB_NAME == *"code-coverage" ]]; then
11 COVERAGE="--with-coverage"
Zhiyi Zhang8617a792017-01-17 16:45:56 -080012fi
13
Davide Pesavento552174c2020-04-16 01:54:08 -040014if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
15 # Build in release mode with tests
16 ./waf --color=yes configure --with-tests
17 ./waf --color=yes build -j$WAF_JOBS
Zhiyi Zhang8617a792017-01-17 16:45:56 -080018
Davide Pesavento552174c2020-04-16 01:54:08 -040019 # Cleanup
20 ./waf --color=yes distclean
21
22 # Build in release mode without tests
23 ./waf --color=yes configure
24 ./waf --color=yes build -j$WAF_JOBS
25
26 # Cleanup
27 ./waf --color=yes distclean
28fi
29
30# Build in debug mode with tests
31./waf --color=yes configure --debug --with-tests $ASAN $COVERAGE
32./waf --color=yes build -j$WAF_JOBS
33
34# (tests will be run against the debug version)
Zhiyi Zhang8617a792017-01-17 16:45:56 -080035
36# Install
Davide Pesavento552174c2020-04-16 01:54:08 -040037sudo_preserve_env PATH -- ./waf --color=yes install
Zhiyi Zhang7021a932017-03-17 10:26:51 -070038
39if has Linux $NODE_LABELS; then
40 sudo ldconfig
Zhiyi Zhang7021a932017-03-17 10:26:51 -070041fi