From: Nathan Moinvaziri Date: Wed, 8 Feb 2023 08:32:54 +0000 (-0800) Subject: Disable zlib-ng internal tests when BUILD_SHARED_LIBS=ON. X-Git-Tag: 2.1.0-beta1~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=38675bea4ec760ef65bbc37af90b8562fbd93182;p=thirdparty%2Fzlib-ng.git Disable zlib-ng internal tests when BUILD_SHARED_LIBS=ON. When BUILD_SHARED_LIBS=ON some zlib-ng internal functions are not exported, which are used by gtest_zlib and benchmark_zlib. Therefore, we must disable those tests/projects. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 27ce9f477..8aad597f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1179,6 +1179,19 @@ option(ZLIB_ENABLE_TESTS "Build test binaries" ON) if(ZLIB_ENABLE_TESTS) enable_testing() + if(BUILD_SHARED_LIBS) + if(ZLIBNG_ENABLE_TESTS) + message(STATUS "Disabling zlib-ng tests because shared libraries are enabled") + set(ZLIBNG_ENABLE_TESTS OFF) + endif() + + if(WITH_BENCHMARKS OR WITH_BENCHMARK_APPS) + message(STATUS "Disabling benchmarks because shared libraries are enabled") + set(WITH_BENCHMARKS OFF) + set(WITH_BENCHMARK_APPS OFF) + endif() + endif() + add_subdirectory(test) endif()