blob: 848a8d1b17cc0ecd4a1cc571d80fb1972af00fd8 [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
Davide Pesaventoefdb8722023-12-03 16:11:32 -050021 # Build in release mode with examples
22 ./waf --color=yes configure --with-examples
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 Pesaventoefdb8722023-12-03 16:11:32 -050029# Build in debug mode with tests
30./waf --color=yes configure --debug --with-tests $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 == *linux* ]]; then
Davide Pesavento508d2cb2024-02-10 14:55:04 -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 Pesavento8f9d0622018-11-27 01:23:37 -050042 sudo ldconfig
Davide Pesavento8f9d0622018-11-27 01:23:37 -050043fi