From 90302fc5e74bed533f68dbedb25163e98906121d Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Tue, 3 Nov 2020 10:05:33 +0100 Subject: Add cmake building support to Travis CI To make it easier to extend the CI support and to be able to execute the contained tests locally, a dedicated shell script tools/ci_build.sh was added to execute the tests. --- tools/ci-build.sh | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100755 tools/ci-build.sh (limited to 'tools') diff --git a/tools/ci-build.sh b/tools/ci-build.sh new file mode 100755 index 0000000..a7d79b1 --- /dev/null +++ b/tools/ci-build.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +set -euo pipefail +set -x + +# ci_buildsys: +# Build system under test: Makefile or cmake +: "${ci_buildsys:=cmake}" + +# ci_target: +# target to build for +: "${ci_target:=${CROSS_COMPILE%-}}" + +install_prefix=$(${ci_target}-gcc --print-sysroot)/${ci_target} + +case "$ci_buildsys" in + (Makefile) + ./configure --enable-shared --enable-static --enable-wine --cross-prefix=${ci_target}- + make + make test + ;; + + (cmake) + cmake --version + rm -rf build + mkdir build + cd build + cmake \ + --no-warn-unused-cli \ + -DCMAKE_FIND_ROOT_PATH=$install_prefix \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_C_COMPILER=$(which ${ci_target}-gcc) \ + -DCMAKE_SYSTEM_PROCESSOR=${ci_target%-*-*} \ + -DCMAKE_CROSSCOMPILING=TRUE \ + -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \ + -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \ + -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \ + -DCMAKE_SYSTEM_NAME=Windows \ + -DBUILD_TESTS=1 \ + -DENABLE_WINE=ON \ + -DWINE_EXECUTABLE=/usr/bin/wine \ + .. + make + ctest --output-on-failure + make install DESTDIR=$(pwd)/DESTDIR + ;; +esac + +# vim:set sw=4 sts=4 et: -- cgit v1.2.3-55-g6feb