blob: dd6334812e9088e07b38604d4769af9beb3ade37 [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 Pesavento2349e282020-03-24 14:28:03 -04007if has CentOS-8 $NODE_LABELS; then
8 # https://bugzilla.redhat.com/show_bug.cgi?id=1721553
9 PCH="--without-pch"
10fi
11
Davide Pesavento9412d122018-01-02 21:52:09 -050012if [[ $JOB_NAME == *"code-coverage" ]]; then
13 COVERAGE="--with-coverage"
14elif [[ -z $DISABLE_ASAN ]]; then
15 ASAN="--with-sanitizer=address"
16fi
Davide Pesavento9412d122018-01-02 21:52:09 -050017
Davide Pesavento0530b5b2016-11-07 03:23:58 +010018if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
Davide Pesavento97242f72020-02-29 14:28:15 -050019 # Build static library in release mode with tests and without precompiled headers
20 ./waf --color=yes configure --enable-static --disable-shared --with-tests --without-pch
Davide Pesavento2349e282020-03-24 14:28:03 -040021 ./waf --color=yes build -j$WAF_JOBS
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020022
Davide Pesavento97242f72020-02-29 14:28:15 -050023 # Cleanup
Davide Pesaventod776a932020-03-20 18:42:36 -040024 ./waf --color=yes distclean
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020025
Davide Pesavento97242f72020-02-29 14:28:15 -050026 # Build static and shared library in release mode without tests
Davide Pesavento2349e282020-03-24 14:28:03 -040027 ./waf --color=yes configure --enable-static --enable-shared $PCH
28 ./waf --color=yes build -j$WAF_JOBS
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020029
Davide Pesavento97242f72020-02-29 14:28:15 -050030 # Cleanup
Davide Pesaventod776a932020-03-20 18:42:36 -040031 ./waf --color=yes distclean
Davide Pesavento09348882016-09-17 02:39:44 +020032fi
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020033
Davide Pesavento97242f72020-02-29 14:28:15 -050034# Build shared library in debug mode with tests and examples
Davide Pesavento2349e282020-03-24 14:28:03 -040035./waf --color=yes configure --disable-static --enable-shared --debug --with-tests --with-examples $ASAN $COVERAGE $PCH
36./waf --color=yes build -j$WAF_JOBS
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020037
Davide Pesavento97242f72020-02-29 14:28:15 -050038# (tests will be run against the debug version)
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -040039
40# Install
Davide Pesaventocdb5d8f2018-09-05 22:27:49 -040041sudo_preserve_env PATH -- ./waf --color=yes install
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -040042
Davide Pesavento2349e282020-03-24 14:28:03 -040043if has CentOS-8 $NODE_LABELS; then
44 sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64
45fi
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -040046if has Linux $NODE_LABELS; then
47 sudo ldconfig
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -040048fi