blob: 1528655d50855db15009726e23613c666dbe024b [file] [log] [blame]
Davide Pesavento8f9d0622018-11-27 01:23:37 -05001#!/usr/bin/env bash
Davide Pesavento27dd70c2022-08-19 16:24:28 -04002set -eo pipefail
Davide Pesavento8f9d0622018-11-27 01:23:37 -05003
Davide Pesaventoec61b742020-04-18 01:00:12 -04004if [[ -z $DISABLE_ASAN ]]; then
Davide Pesavento8f9d0622018-11-27 01:23:37 -05005 ASAN="--with-sanitizer=address"
6fi
Davide Pesaventoec61b742020-04-18 01:00:12 -04007if [[ $JOB_NAME == *"code-coverage" ]]; then
8 COVERAGE="--with-coverage"
Davide Pesavento8f9d0622018-11-27 01:23:37 -05009fi
10
Davide Pesavento27dd70c2022-08-19 16:24:28 -040011set -x
12
Davide Pesaventoec61b742020-04-18 01:00:12 -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 Pesavento27dd70c2022-08-19 16:24:28 -040016 ./waf --color=yes build
Davide Pesavento8f9d0622018-11-27 01:23:37 -050017
Davide Pesaventoec61b742020-04-18 01:00:12 -040018 # Cleanup
19 ./waf --color=yes distclean
20
21 # Build in release mode without tests
22 ./waf --color=yes configure
Davide Pesavento27dd70c2022-08-19 16:24:28 -040023 ./waf --color=yes build
Davide Pesaventoec61b742020-04-18 01:00:12 -040024
25 # Cleanup
26 ./waf --color=yes distclean
27fi
28
Davide Pesaventod4689c82021-10-07 02:53:03 -040029# Build in debug mode with tests and examples
30./waf --color=yes configure --debug --with-tests --with-examples $ASAN $COVERAGE
Davide Pesavento27dd70c2022-08-19 16:24:28 -040031./waf --color=yes build
Davide Pesaventoec61b742020-04-18 01:00:12 -040032
33# (tests will be run against the debug version)
Davide Pesavento8f9d0622018-11-27 01:23:37 -050034
35# Install
Davide Pesavento27dd70c2022-08-19 16:24:28 -040036sudo ./waf --color=yes install
Davide Pesavento8f9d0622018-11-27 01:23:37 -050037
Davide Pesavento27dd70c2022-08-19 16:24:28 -040038if [[ $ID_LIKE == *fedora* ]]; then
Davide Pesavento7e7bd892022-07-10 00:30:06 -040039 sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64
40fi
Davide Pesavento27dd70c2022-08-19 16:24:28 -040041if [[ $ID_LIKE == *linux* ]]; then
Davide Pesavento8f9d0622018-11-27 01:23:37 -050042 sudo ldconfig
Davide Pesavento8f9d0622018-11-27 01:23:37 -050043fi