blob: 7760261ce8bfe1cd3f03708f4b3f6a91c58026bb [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 Pesavento440000d2025-03-25 15:50:12 -04007if [[ $JOB_NAME == *code-coverage ]]; then
Davide Pesavento552174c2020-04-16 01:54:08 -04008 COVERAGE="--with-coverage"
Zhiyi Zhang8617a792017-01-17 16:45:56 -08009fi
10
Davide Pesavento6d1b6722022-08-20 17:54:05 -040011set -x
12
Davide Pesavento440000d2025-03-25 15:50:12 -040013if [[ $JOB_NAME != *code-coverage && $JOB_NAME != *limited-build ]]; then
Davide Pesavento552174c2020-04-16 01:54:08 -040014 # 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
Zhiyi Zhang8617a792017-01-17 16:45:56 -080033# Install
Davide Pesavento6d1b6722022-08-20 17:54:05 -040034sudo ./waf --color=yes install
Zhiyi Zhang7021a932017-03-17 10:26:51 -070035
Davide Pesavento6d1b6722022-08-20 17:54:05 -040036if [[ $ID_LIKE == *linux* ]]; then
Davide Pesavento526d4c82024-02-09 18:56:05 -050037 if [[ $(uname -m) == x86_64 && -d /usr/lib64 ]]; then
38 sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64
39 fi
Zhiyi Zhang7021a932017-03-17 10:26:51 -070040 sudo ldconfig
Zhiyi Zhang7021a932017-03-17 10:26:51 -070041fi