blob: 3d2e3bb3c72eafa102f4a2a0decf9299ed459c89 [file] [log] [blame]
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -04001#!/usr/bin/env bash
Alexander Afanasyev33ce4c32014-10-24 11:19:45 -07002set -e
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -04003
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -04004JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5source "$JDIR"/util.sh
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -04006
Davide Pesavento09348882016-09-17 02:39:44 +02007set -x
8
Davide Pesavento71430482017-06-08 20:06:40 -04009sudo rm -f /usr/local/bin/ndnsec*
10sudo rm -fr /usr/local/include/ndn-cxx
Md Ashiqur Rahman8bd3b8a2018-09-01 23:43:51 +000011sudo rm -f /usr/local/lib{,64}/libndn-cxx*
12sudo rm -f /usr/local/lib{,64}/pkgconfig/libndn-cxx.pc
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -040013
Davide Pesavento9412d122018-01-02 21:52:09 -050014if [[ $JOB_NAME == *"code-coverage" ]]; then
15 COVERAGE="--with-coverage"
16elif [[ -z $DISABLE_ASAN ]]; then
17 ASAN="--with-sanitizer=address"
18fi
Davide Pesavento9412d122018-01-02 21:52:09 -050019
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020020# Cleanup
Davide Pesaventocdb5d8f2018-09-05 22:27:49 -040021sudo_preserve_env PATH -- ./waf --color=yes distclean
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -040022
Davide Pesavento0530b5b2016-11-07 03:23:58 +010023if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
Davide Pesavento97242f72020-02-29 14:28:15 -050024 # Build static library in release mode with tests and without precompiled headers
25 ./waf --color=yes configure --enable-static --disable-shared --with-tests --without-pch
26 ./waf --color=yes build -j${WAF_JOBS:-1}
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020027
Davide Pesavento97242f72020-02-29 14:28:15 -050028 # Cleanup
29 sudo_preserve_env PATH -- ./waf --color=yes distclean
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020030
Davide Pesavento97242f72020-02-29 14:28:15 -050031 # Build static and shared library in release mode without tests
32 ./waf --color=yes configure --enable-static --enable-shared
33 ./waf --color=yes build -j${WAF_JOBS:-1}
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020034
Davide Pesavento97242f72020-02-29 14:28:15 -050035 # Cleanup
36 sudo_preserve_env PATH -- ./waf --color=yes distclean
Davide Pesavento09348882016-09-17 02:39:44 +020037fi
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020038
Davide Pesavento97242f72020-02-29 14:28:15 -050039# Build shared library in debug mode with tests and examples
40./waf --color=yes configure --disable-static --enable-shared --debug --with-tests --with-examples $ASAN $COVERAGE
Davide Pesavento3cf90782017-08-10 01:21:20 -040041./waf --color=yes build -j${WAF_JOBS:-1}
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020042
Davide Pesavento97242f72020-02-29 14:28:15 -050043# (tests will be run against the debug version)
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -040044
45# Install
Davide Pesaventocdb5d8f2018-09-05 22:27:49 -040046sudo_preserve_env PATH -- ./waf --color=yes install
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -040047
48if has Linux $NODE_LABELS; then
49 sudo ldconfig
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -040050fi