]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Make test options dependent on ZLIB_ENABLE_TESTS develop
authorCameron Cawley <ccawley2011@gmail.com>
Fri, 11 Jul 2025 12:19:02 +0000 (13:19 +0100)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Mon, 28 Jul 2025 10:14:49 +0000 (12:14 +0200)
CMakeLists.txt

index 5af517de1ea041812047624150a82ee4b0773087..3888508915ac9c4c7bf14d96093e58fb03bd07d1 100644 (file)
@@ -48,9 +48,12 @@ include(CMakePackageConfigHelpers)
 include(FeatureSummary)
 
 # We need to enable C++ before trying to check for coverage
-option(WITH_GTEST "Build gtest_zlib" ON)
-option(WITH_FUZZERS "Build test/fuzz" OFF)
-option(WITH_BENCHMARKS "Build test/benchmarks" OFF)
+option(ZLIB_ENABLE_TESTS "Build test binaries" ON)
+cmake_dependent_option(ZLIBNG_ENABLE_TESTS "Test zlib-ng specific API" ON "ZLIB_ENABLE_TESTS" OFF)
+cmake_dependent_option(WITH_GTEST "Build gtest_zlib" ON "ZLIB_ENABLE_TESTS" OFF)
+cmake_dependent_option(WITH_FUZZERS "Build test/fuzz" OFF "ZLIB_ENABLE_TESTS" OFF)
+cmake_dependent_option(WITH_BENCHMARKS "Build test/benchmarks" OFF "ZLIB_ENABLE_TESTS" OFF)
+cmake_dependent_option(WITH_BENCHMARK_APPS "Build application benchmarks" OFF "WITH_BENCHMARKS" OFF)
 
 if(WITH_GTEST OR WITH_FUZZERS OR WITH_BENCHMARKS)
   enable_language(CXX)
@@ -86,9 +89,6 @@ endif()
 #
 option(WITH_GZFILEOP "Compile with support for gzFile related functions" ON)
 option(ZLIB_COMPAT "Compile with zlib compatible API" OFF)
-option(ZLIB_ENABLE_TESTS "Build test binaries" ON)
-option(ZLIBNG_ENABLE_TESTS "Test zlib-ng specific API" ON)
-option(WITH_BENCHMARK_APPS "Build application benchmarks" OFF)
 option(WITH_OPTIM "Build with optimisation" ON)
 option(WITH_REDUCED_MEM "Reduced memory usage for special cases (reduces performance)" OFF)
 option(WITH_NEW_STRATEGIES "Use new strategies" ON)