blob: f703092ddfe5d151eac585c4f5c3bf5dc355102b [file] [log] [blame]
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -04001#!/usr/bin/env bash
Davide Pesavento2349e282020-03-24 14:28:03 -04002set -ex
Davide Pesavento09348882016-09-17 02:39:44 +02003
Davide Pesaventod776a932020-03-20 18:42:36 -04004git submodule sync
5git submodule update --init
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -04006
Davide Pesaventoab7300b2020-04-09 00:51:41 -04007if [[ -z $DISABLE_ASAN ]]; then
8 ASAN="--with-sanitizer=address"
9fi
10if [[ $JOB_NAME == *"code-coverage" ]]; then
11 COVERAGE="--with-coverage"
12fi
Davide Pesaventof6625002022-07-31 17:15:02 -040013if has macos-12 $NODE_LABELS; then
14 KEYCHAIN="--without-osx-keychain"
15fi
Davide Pesaventofbca6112022-07-03 16:31:04 -040016if [[ -n $DISABLE_PCH ]]; then
Davide Pesavento2349e282020-03-24 14:28:03 -040017 PCH="--without-pch"
18fi
19
Davide Pesavento0530b5b2016-11-07 03:23:58 +010020if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
Davide Pesavento97242f72020-02-29 14:28:15 -050021 # Build static library in release mode with tests and without precompiled headers
22 ./waf --color=yes configure --enable-static --disable-shared --with-tests --without-pch
Davide Pesavento2349e282020-03-24 14:28:03 -040023 ./waf --color=yes build -j$WAF_JOBS
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020024
Davide Pesavento97242f72020-02-29 14:28:15 -050025 # Cleanup
Davide Pesaventod776a932020-03-20 18:42:36 -040026 ./waf --color=yes distclean
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020027
Davide Pesavento97242f72020-02-29 14:28:15 -050028 # Build static and shared library in release mode without tests
Davide Pesavento2349e282020-03-24 14:28:03 -040029 ./waf --color=yes configure --enable-static --enable-shared $PCH
30 ./waf --color=yes build -j$WAF_JOBS
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020031
Davide Pesavento97242f72020-02-29 14:28:15 -050032 # Cleanup
Davide Pesaventod776a932020-03-20 18:42:36 -040033 ./waf --color=yes distclean
Davide Pesavento09348882016-09-17 02:39:44 +020034fi
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020035
Davide Pesavento97242f72020-02-29 14:28:15 -050036# Build shared library in debug mode with tests and examples
Davide Pesaventof6625002022-07-31 17:15:02 -040037./waf --color=yes configure --disable-static --enable-shared --debug --with-tests --with-examples $ASAN $COVERAGE $KEYCHAIN $PCH
Davide Pesavento2349e282020-03-24 14:28:03 -040038./waf --color=yes build -j$WAF_JOBS
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020039
Davide Pesavento97242f72020-02-29 14:28:15 -050040# (tests will be run against the debug version)
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -040041
42# Install
Davide Pesaventocdb5d8f2018-09-05 22:27:49 -040043sudo_preserve_env PATH -- ./waf --color=yes install
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -040044
Davide Pesaventofbca6112022-07-03 16:31:04 -040045if has CentOS $NODE_LABELS; then
Davide Pesavento2349e282020-03-24 14:28:03 -040046 sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64
47fi
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -040048if has Linux $NODE_LABELS; then
49 sudo ldconfig
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -040050fi