blob: a4e6cd59d54756d202628dfc5ffe446bfd9efbd3 [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 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 Pesavento0530b5b2016-11-07 03:23:58 +010017if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
Davide Pesavento97242f72020-02-29 14:28:15 -050018 # Build static library in release mode with tests and without precompiled headers
19 ./waf --color=yes configure --enable-static --disable-shared --with-tests --without-pch
Davide Pesavento2349e282020-03-24 14:28:03 -040020 ./waf --color=yes build -j$WAF_JOBS
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020021
Davide Pesavento97242f72020-02-29 14:28:15 -050022 # Cleanup
Davide Pesaventod776a932020-03-20 18:42:36 -040023 ./waf --color=yes distclean
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020024
Davide Pesavento97242f72020-02-29 14:28:15 -050025 # Build static and shared library in release mode without tests
Davide Pesavento2349e282020-03-24 14:28:03 -040026 ./waf --color=yes configure --enable-static --enable-shared $PCH
27 ./waf --color=yes build -j$WAF_JOBS
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020028
Davide Pesavento97242f72020-02-29 14:28:15 -050029 # Cleanup
Davide Pesaventod776a932020-03-20 18:42:36 -040030 ./waf --color=yes distclean
Davide Pesavento09348882016-09-17 02:39:44 +020031fi
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020032
Davide Pesavento97242f72020-02-29 14:28:15 -050033# Build shared library in debug mode with tests and examples
Davide Pesavento2349e282020-03-24 14:28:03 -040034./waf --color=yes configure --disable-static --enable-shared --debug --with-tests --with-examples $ASAN $COVERAGE $PCH
35./waf --color=yes build -j$WAF_JOBS
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020036
Davide Pesavento97242f72020-02-29 14:28:15 -050037# (tests will be run against the debug version)
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -040038
39# Install
Davide Pesaventocdb5d8f2018-09-05 22:27:49 -040040sudo_preserve_env PATH -- ./waf --color=yes install
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -040041
Davide Pesaventofbca6112022-07-03 16:31:04 -040042if has CentOS $NODE_LABELS; then
Davide Pesavento2349e282020-03-24 14:28:03 -040043 sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64
44fi
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -040045if has Linux $NODE_LABELS; then
46 sudo ldconfig
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -040047fi