blob: 82ec98e114daea033d0508a6f974b22e7a38ee5a [file] [log] [blame]
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -04001#!/usr/bin/env bash
Davide Pesavento73e946e2022-08-06 16:44:54 -04002set -eo pipefail
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -04003
Davide Pesaventoab7300b2020-04-09 00:51:41 -04004if [[ -z $DISABLE_ASAN ]]; then
5 ASAN="--with-sanitizer=address"
6fi
7if [[ $JOB_NAME == *"code-coverage" ]]; then
8 COVERAGE="--with-coverage"
9fi
Davide Pesavento73e946e2022-08-06 16:44:54 -040010if [[ $ID == macos && ${VERSION_ID%%.*} -ge 12 ]]; then
Davide Pesaventof6625002022-07-31 17:15:02 -040011 KEYCHAIN="--without-osx-keychain"
12fi
Davide Pesaventofbca6112022-07-03 16:31:04 -040013if [[ -n $DISABLE_PCH ]]; then
Davide Pesavento2349e282020-03-24 14:28:03 -040014 PCH="--without-pch"
15fi
16
Davide Pesavento73e946e2022-08-06 16:44:54 -040017set -x
18
Davide Pesavento0530b5b2016-11-07 03:23:58 +010019if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
Davide Pesavento97242f72020-02-29 14:28:15 -050020 # Build static library in release mode with tests and without precompiled headers
21 ./waf --color=yes configure --enable-static --disable-shared --with-tests --without-pch
Davide Pesavento73e946e2022-08-06 16:44:54 -040022 ./waf --color=yes build
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020023
Davide Pesavento97242f72020-02-29 14:28:15 -050024 # Cleanup
Davide Pesaventod776a932020-03-20 18:42:36 -040025 ./waf --color=yes distclean
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020026
Davide Pesavento97242f72020-02-29 14:28:15 -050027 # Build static and shared library in release mode without tests
Davide Pesavento2349e282020-03-24 14:28:03 -040028 ./waf --color=yes configure --enable-static --enable-shared $PCH
Davide Pesavento73e946e2022-08-06 16:44:54 -040029 ./waf --color=yes build
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020030
Davide Pesavento97242f72020-02-29 14:28:15 -050031 # Cleanup
Davide Pesaventod776a932020-03-20 18:42:36 -040032 ./waf --color=yes distclean
Davide Pesavento09348882016-09-17 02:39:44 +020033fi
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020034
Davide Pesavento97242f72020-02-29 14:28:15 -050035# Build shared library in debug mode with tests and examples
Davide Pesaventof6625002022-07-31 17:15:02 -040036./waf --color=yes configure --disable-static --enable-shared --debug --with-tests --with-examples $ASAN $COVERAGE $KEYCHAIN $PCH
Davide Pesavento73e946e2022-08-06 16:44:54 -040037./waf --color=yes build
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020038
Davide Pesavento97242f72020-02-29 14:28:15 -050039# (tests will be run against the debug version)
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -040040
41# Install
Davide Pesavento73e946e2022-08-06 16:44:54 -040042sudo ./waf --color=yes install
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -040043
Davide Pesavento73e946e2022-08-06 16:44:54 -040044if [[ $ID_LIKE == *fedora* ]]; then
Davide Pesavento2349e282020-03-24 14:28:03 -040045 sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64
46fi
Davide Pesavento73e946e2022-08-06 16:44:54 -040047if [[ $ID_LIKE == *linux* ]]; then
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -040048 sudo ldconfig
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -040049fi