blob: 830d3e8921c3c89c09290acfbb886288f98589d3 [file] [log] [blame]
Davide Pesavento7ef57e22017-10-28 16:58:43 -04001#!/usr/bin/env bash
Davide Pesavento15a74422022-08-19 15:48:45 -04002set -eo pipefail
Davide Pesavento7ef57e22017-10-28 16:58:43 -04003
Davide Pesaventoa0546db2020-04-01 19:18:04 -04004if [[ -z $DISABLE_ASAN ]]; then
Davide Pesavento5188f312019-03-18 18:38:45 -04005 ASAN="--with-sanitizer=address"
6fi
Davide Pesaventoa0546db2020-04-01 19:18:04 -04007if [[ $JOB_NAME == *"code-coverage" ]]; then
8 COVERAGE="--with-coverage"
Davide Pesavento7ef57e22017-10-28 16:58:43 -04009fi
10
Davide Pesavento15a74422022-08-19 15:48:45 -040011set -x
12
Davide Pesaventoa0546db2020-04-01 19:18:04 -040013if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
14 # Build in release mode with tests
15 ./waf --color=yes configure --with-tests
Davide Pesavento15a74422022-08-19 15:48:45 -040016 ./waf --color=yes build
Davide Pesavento7ef57e22017-10-28 16:58:43 -040017
Davide Pesaventoa0546db2020-04-01 19:18:04 -040018 # Cleanup
19 ./waf --color=yes distclean
20
21 # Build in release mode without tests
22 ./waf --color=yes configure
Davide Pesavento15a74422022-08-19 15:48:45 -040023 ./waf --color=yes build
Davide Pesaventoa0546db2020-04-01 19:18:04 -040024
25 # Cleanup
26 ./waf --color=yes distclean
27fi
28
29# Build in debug mode with tests
30./waf --color=yes configure --debug --with-tests $ASAN $COVERAGE
Davide Pesavento15a74422022-08-19 15:48:45 -040031./waf --color=yes build
Davide Pesaventoa0546db2020-04-01 19:18:04 -040032
33# (tests will be run against the debug version)
Davide Pesavento7ef57e22017-10-28 16:58:43 -040034
35# Install
Davide Pesavento15a74422022-08-19 15:48:45 -040036sudo ./waf --color=yes install
Davide Pesavento7ef57e22017-10-28 16:58:43 -040037
Davide Pesavento15a74422022-08-19 15:48:45 -040038if [[ $ID_LIKE == *linux* ]]; then
Davide Pesaventoc6cfed62024-02-09 21:18:06 -050039 if [[ $(uname -m) == x86_64 && -d /usr/lib64 ]]; then
40 sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64
41 fi
Davide Pesavento7ef57e22017-10-28 16:58:43 -040042 sudo ldconfig
Davide Pesavento7ef57e22017-10-28 16:58:43 -040043fi