Jan Kundrát | d9d26a9 | 2018-02-22 12:49:21 +0100 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | set -eux -o pipefail |
| 4 | shopt -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. |
| 8 | PREFIX=~/target |
| 9 | mkdir ${PREFIX} |
| 10 | export PATH=${PREFIX}/bin:$PATH |
| 11 | export LD_LIBRARY_PATH=${PREFIX}/lib64:${PREFIX}/lib |
| 12 | export PKG_CONFIG_PATH=${PREFIX}/lib64/pkgconfig:${PREFIX}/lib/pkgconfig |
| 13 | |
| 14 | if [[ $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" |
| 17 | fi |
| 18 | |
| 19 | # force-enable tests for packages which use, eh, interesting setup |
| 20 | # - libyang and libnetconf2 copmare CMAKE_BUILD_TYPE to lowercase "debug"... |
| 21 | CMAKE_OPTIONS="${CMAKE_OPTIONS} -DENABLE_BUILD_TESTS=ON -DENABLE_VALGRIND_TESTS=OFF" |
| 22 | |
| 23 | mkdir -p ${ZUUL_PROJECT}/build |
| 24 | cd ${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} |
| 30 | ninja-build |
| 31 | |
| 32 | ${CTEST} --output-on-failure |