blob: fb8346a453d005cb9f96d6152c357379ce3750de [file] [log] [blame]
Jan Kundrátd9d26a92018-02-22 12:49:21 +01001#!/bin/bash
2
3set -eux -o pipefail
4shopt -s failglob
5
6# We're reusing our artifacts, so we absolutely need a stable destdir.
7# Turbo-hipster takes care of cleaning up the mess betweeb builds.
8PREFIX=~/target
9mkdir ${PREFIX}
10export PATH=${PREFIX}/bin:$PATH
11export LD_LIBRARY_PATH=${PREFIX}/lib64:${PREFIX}/lib
12export PKG_CONFIG_PATH=${PREFIX}/lib64/pkgconfig:${PREFIX}/lib/pkgconfig
13
14if [[ $TH_JOB_NAME =~ .*-sanitizers-.* ]]; then
15 # https://gitlab.kitware.com/cmake/cmake/issues/16609
16 CMAKE_OPTIONS="${CMAKE_OPTIONS} -DTHREADS_HAVE_PTHREAD_ARG:BOOL=ON"
17fi
18
19# force-enable tests for packages which use, eh, interesting setup
20# - libyang and libnetconf2 copmare CMAKE_BUILD_TYPE to lowercase "debug"...
21CMAKE_OPTIONS="${CMAKE_OPTIONS} -DENABLE_BUILD_TESTS=ON -DENABLE_VALGRIND_TESTS=OFF"
22
23mkdir -p ${ZUUL_PROJECT}/build
24cd ${ZUUL_PROJECT}/build
25${CMAKE} -GNinja \
26 -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-Debug} \
27 -DCMAKE_INSTALL_PREFIX=${PREFIX} \
28 ${CMAKE_OPTIONS} \
29 ${TH_GIT_PATH}
30ninja-build
31
32${CTEST} --output-on-failure