blob: 66ec27f02a30c1830fb4c8ee7b86dc89805e34d4 [file] [log] [blame]
#!/usr/bin/env bash
set -e
JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
source "$JDIR"/util.sh
set -x
sudo rm -f /usr/local/bin/ndnsec*
sudo rm -fr /usr/local/include/ndn-cxx
sudo rm -f /usr/local/lib{,64}/libndn-cxx*
sudo rm -f /usr/local/lib{,64}/pkgconfig/libndn-cxx.pc
if [[ $JOB_NAME == *"code-coverage" ]]; then
COVERAGE="--with-coverage"
elif [[ -z $DISABLE_ASAN ]]; then
ASAN="--with-sanitizer=address"
fi
if [[ -n $USE_OPENSSL_1_1 ]] && has OSX $NODE_LABELS; then
OPENSSL="--with-openssl=/usr/local/opt/openssl@1.1"
fi
# Cleanup
sudo_preserve_env PATH -- ./waf --color=yes distclean
if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
# Configure/build static library in optimized mode with tests
./waf --color=yes configure --enable-static --disable-shared --with-tests $OPENSSL
./waf --color=yes build -j${WAF_JOBS:-1}
# Cleanup
sudo_preserve_env PATH -- ./waf --color=yes distclean
# Configure/build static and shared library in optimized mode without tests
./waf --color=yes configure --enable-static --enable-shared $OPENSSL
./waf --color=yes build -j${WAF_JOBS:-1}
# Cleanup
sudo_preserve_env PATH -- ./waf --color=yes distclean
fi
# Configure/build shared library in debug mode with tests/examples and without precompiled headers
./waf --color=yes configure --disable-static --enable-shared --debug --with-tests \
--with-examples --without-pch $ASAN $COVERAGE $OPENSSL
./waf --color=yes build -j${WAF_JOBS:-1}
# (tests will be run against debug version)
# Install
sudo_preserve_env PATH -- ./waf --color=yes install
if has Linux $NODE_LABELS; then
sudo ldconfig
fi