blob: 9c6cb7c1f44321135552d9d59b43336e7cafffc9 [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
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -04009sudo rm -Rf /usr/local/include/ndn-cxx
10sudo rm -f /usr/local/lib/libndn-cxx*
11sudo rm -f /usr/local/lib/pkgconfig/libndn-cxx*
12
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020013# Cleanup
14sudo ./waf -j1 --color=yes distclean
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -040015
Davide Pesavento0530b5b2016-11-07 03:23:58 +010016if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
Davide Pesavento09348882016-09-17 02:39:44 +020017 # Configure/build static library in optimized mode with tests
18 ./waf -j1 --color=yes configure --enable-static --disable-shared --with-tests
19 ./waf -j1 --color=yes build
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020020
Davide Pesavento09348882016-09-17 02:39:44 +020021 # Cleanup
22 sudo ./waf -j1 --color=yes distclean
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020023
Davide Pesavento09348882016-09-17 02:39:44 +020024 # Configure/build static and shared library in optimized mode without tests
25 ./waf -j1 --color=yes configure --enable-static --enable-shared
26 ./waf -j1 --color=yes build
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020027
Davide Pesavento09348882016-09-17 02:39:44 +020028 # Cleanup
29 sudo ./waf -j1 --color=yes distclean
30fi
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020031
Davide Pesavento09348882016-09-17 02:39:44 +020032# Configure/build shared library in debug mode with tests/examples and without precompiled headers
Davide Pesavento0530b5b2016-11-07 03:23:58 +010033if [[ $JOB_NAME == *"code-coverage" ]]; then
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -040034 COVERAGE="--with-coverage"
Davide Pesavento50e20022016-09-17 18:50:27 +020035elif ! has OSX-10.9 $NODE_LABELS && ! has OSX-10.11 $NODE_LABELS; then
36 ASAN="--with-sanitizer=address"
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -040037fi
Davide Pesavento50e20022016-09-17 18:50:27 +020038./waf -j1 --color=yes configure --disable-static --enable-shared --debug --with-tests --with-examples --without-pch $COVERAGE $ASAN
Davide Pesaventodfe9c6b2014-08-25 21:17:10 +020039./waf -j1 --color=yes build
40
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -040041# (tests will be run against debug version)
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -040042
43# Install
44sudo ./waf -j1 --color=yes install
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -040045
46if has Linux $NODE_LABELS; then
47 sudo ldconfig
48elif has FreeBSD $NODE_LABELS; then
49 sudo ldconfig -a
50fi