blob: 23c2987d00752f157cab19facc3edc32e57282f5 [file] [log] [blame]
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -05001#!/usr/bin/env bash
Davide Pesavento133067f2020-04-02 22:08:27 -04002set -ex
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -05003
Davide Pesavento133067f2020-04-02 22:08:27 -04004git submodule sync
5git submodule update --init
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -05006
Davide Pesavento133067f2020-04-02 22:08:27 -04007if [[ -z $DISABLE_ASAN ]]; then
Davide Pesavento1526fee2019-03-18 19:31:55 -04008 ASAN="--with-sanitizer=address"
9fi
Davide Pesavento133067f2020-04-02 22:08:27 -040010if [[ $JOB_NAME == *"code-coverage" ]]; then
11 COVERAGE="--with-coverage"
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050012fi
13
Davide Pesavento133067f2020-04-02 22:08:27 -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
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050018
Davide Pesavento133067f2020-04-02 22:08:27 -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 and examples
31./waf --color=yes configure --debug --with-tests --with-examples $ASAN $COVERAGE
32./waf --color=yes build -j$WAF_JOBS
33
34# (tests will be run against the debug version)
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050035
36# Install
Davide Pesavento1526fee2019-03-18 19:31:55 -040037sudo_preserve_env PATH -- ./waf --color=yes install
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050038
Davide Pesaventof2784382022-07-09 19:58:53 -040039if has CentOS $NODE_LABELS; then
40 sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64
41fi
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050042if has Linux $NODE_LABELS; then
43 sudo ldconfig
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050044fi