blob: 23c2987d00752f157cab19facc3edc32e57282f5 [file] [log] [blame]
Davide Pesavento8f9d0622018-11-27 01:23:37 -05001#!/usr/bin/env bash
Davide Pesaventoec61b742020-04-18 01:00:12 -04002set -ex
Davide Pesavento8f9d0622018-11-27 01:23:37 -05003
Davide Pesaventoec61b742020-04-18 01:00:12 -04004git submodule sync
5git submodule update --init
Davide Pesavento8f9d0622018-11-27 01:23:37 -05006
Davide Pesaventoec61b742020-04-18 01:00:12 -04007if [[ -z $DISABLE_ASAN ]]; then
Davide Pesavento8f9d0622018-11-27 01:23:37 -05008 ASAN="--with-sanitizer=address"
9fi
Davide Pesaventoec61b742020-04-18 01:00:12 -040010if [[ $JOB_NAME == *"code-coverage" ]]; then
11 COVERAGE="--with-coverage"
Davide Pesavento8f9d0622018-11-27 01:23:37 -050012fi
13
Davide Pesaventoec61b742020-04-18 01:00:12 -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
Davide Pesavento8f9d0622018-11-27 01:23:37 -050018
Davide Pesaventoec61b742020-04-18 01:00:12 -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
Davide Pesaventod4689c82021-10-07 02:53:03 -040030# Build in debug mode with tests and examples
31./waf --color=yes configure --debug --with-tests --with-examples $ASAN $COVERAGE
Davide Pesaventoec61b742020-04-18 01:00:12 -040032./waf --color=yes build -j$WAF_JOBS
33
34# (tests will be run against the debug version)
Davide Pesavento8f9d0622018-11-27 01:23:37 -050035
36# Install
37sudo_preserve_env PATH -- ./waf --color=yes install
38
Davide Pesavento7e7bd892022-07-10 00:30:06 -040039if has CentOS $NODE_LABELS; then
40 sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64
41fi
Davide Pesavento8f9d0622018-11-27 01:23:37 -050042if has Linux $NODE_LABELS; then
43 sudo ldconfig
Davide Pesavento8f9d0622018-11-27 01:23:37 -050044fi