From edfbb1ced652a93fd39c38338be9eb0f444f6e41 Mon Sep 17 00:00:00 2001 From: Bill Torpey Date: Tue, 3 May 2022 17:18:44 -0400 Subject: [PATCH] default to not building tests if cmake version can't handle skipped tests (#4376) * default to not building tests if cmake version can't handle skipped tests (see https://github.com/zeromq/libzmq/issues/4375) --- CMakeLists.txt | 6 +++++- builds/cmake/ci_build.sh | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a2347e8e..23c5c1dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1625,7 +1625,11 @@ endif() # ----------------------------------------------------------------------------- # tests -option(BUILD_TESTS "Whether or not to build the tests" ON) +if(${CMAKE_VERSION} VERSION_LESS 3.12.3) + option(BUILD_TESTS "Whether or not to build the tests" OFF) +else() + option(BUILD_TESTS "Whether or not to build the tests" ON) +endif() set(ZMQ_BUILD_TESTS ${BUILD_TESTS} diff --git a/builds/cmake/ci_build.sh b/builds/cmake/ci_build.sh index c7b61fde..7d287bc4 100755 --- a/builds/cmake/ci_build.sh +++ b/builds/cmake/ci_build.sh @@ -31,6 +31,7 @@ CMAKE_OPTS+=("-DCMAKE_PREFIX_PATH:PATH=${BUILD_PREFIX}") CMAKE_OPTS+=("-DCMAKE_LIBRARY_PATH:PATH=${BUILD_PREFIX}/lib") CMAKE_OPTS+=("-DCMAKE_INCLUDE_PATH:PATH=${BUILD_PREFIX}/include") CMAKE_OPTS+=("-DENABLE_CAPSH=ON") +CMAKE_OPTS+=("-DBUILD_TESTS=ON") if [ "$CLANG_FORMAT" != "" ] ; then CMAKE_OPTS+=("-DCLANG_FORMAT=${CLANG_FORMAT}")