blob: 2180a9376fb605b42986c6c587613f53ad54dcd9 [file] [log] [blame]
Zhiyi Zhang8617a792017-01-17 16:45:56 -08001#!/usr/bin/env bash
Davide Pesavento6d1b6722022-08-20 17:54:05 -04002set -eo pipefail
Zhiyi Zhang8617a792017-01-17 16:45:56 -08003
Davide Pesavento552174c2020-04-16 01:54:08 -04004if [[ -z $DISABLE_ASAN ]]; then
Davide Pesaventocf9ffe42018-01-21 22:21:53 -05005 ASAN="--with-sanitizer=address"
6fi
Davide Pesavento552174c2020-04-16 01:54:08 -04007if [[ $JOB_NAME == *"code-coverage" ]]; then
8 COVERAGE="--with-coverage"
Zhiyi Zhang8617a792017-01-17 16:45:56 -08009fi
10
Davide Pesavento6d1b6722022-08-20 17:54:05 -040011set -x
12
Davide Pesavento552174c2020-04-16 01:54:08 -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 Pesavento6d1b6722022-08-20 17:54:05 -040016 ./waf --color=yes build
Zhiyi Zhang8617a792017-01-17 16:45:56 -080017
Davide Pesavento552174c2020-04-16 01:54:08 -040018 # Cleanup
19 ./waf --color=yes distclean
20
21 # Build in release mode without tests
22 ./waf --color=yes configure
Davide Pesavento6d1b6722022-08-20 17:54:05 -040023 ./waf --color=yes build
Davide Pesavento552174c2020-04-16 01:54:08 -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 Pesavento6d1b6722022-08-20 17:54:05 -040031./waf --color=yes build
Davide Pesavento552174c2020-04-16 01:54:08 -040032
33# (tests will be run against the debug version)
Zhiyi Zhang8617a792017-01-17 16:45:56 -080034
35# Install
Davide Pesavento6d1b6722022-08-20 17:54:05 -040036sudo ./waf --color=yes install
Zhiyi Zhang7021a932017-03-17 10:26:51 -070037
Davide Pesavento6d1b6722022-08-20 17:54:05 -040038if [[ $ID_LIKE == *fedora* ]]; then
Davide Pesavento573a6212022-07-09 21:56:41 -040039 sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64
40fi
Davide Pesavento6d1b6722022-08-20 17:54:05 -040041if [[ $ID_LIKE == *linux* ]]; then
Zhiyi Zhang7021a932017-03-17 10:26:51 -070042 sudo ldconfig
Zhiyi Zhang7021a932017-03-17 10:26:51 -070043fi