From: Nathan Moinvaziri Date: Sat, 20 Aug 2022 16:55:49 +0000 (-0700) Subject: Remove ZLIB_DUAL_LINK option to simplify dual link tests. X-Git-Tag: 2.1.0-beta1~180 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8df665005952cdbe7dc995d409ffe4f861e7a83e;p=thirdparty%2Fzlib-ng.git Remove ZLIB_DUAL_LINK option to simplify dual link tests. --- diff --git a/.github/workflows/link.yml b/.github/workflows/link.yml index 2b9000cd..806a9341 100644 --- a/.github/workflows/link.yml +++ b/.github/workflows/link.yml @@ -21,7 +21,7 @@ jobs: run: cmake --build zlib/build --config Release - name: Generate project files (native) - run: cmake -S . -B native -DZLIB_COMPAT=OFF -DZLIB_DUAL_LINK=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DZLIB_ROOT=../zlib/build -DZLIB_LIBRARIES=../zlib/build/libz.a -DZLIB_INCLUDE_DIR=../zlib/build + run: cmake -S . -B native -DZLIB_COMPAT=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DZLIB_LIBRARIES=../zlib/build/libz.a -DZLIB_INCLUDE_DIR=../zlib/build - name: Compile source code (native) run: cmake --build native --config Release @@ -50,7 +50,7 @@ jobs: run: cmake --build compat --config Release - name: Generate project files (native) - run: cmake -S . -B native -DZLIB_COMPAT=OFF -DZLIB_DUAL_LINK=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DZLIB_ROOT=../compat -DZLIB_LIBRARIES=../compat/libz.a -DZLIB_INCLUDE_DIR=../compat + run: cmake -S . -B native -DZLIB_COMPAT=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DZLIB_LIBRARIES=../compat/libz.a -DZLIB_INCLUDE_DIR=../compat - name: Compile source code (native) run: cmake --build native --config Release diff --git a/CMakeLists.txt b/CMakeLists.txt index fafedb9c..c403e5b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,7 +76,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(ZLIB_DUAL_LINK "Dual link tests against system zlib" OFF) option(WITH_FUZZERS "Build test/fuzz" OFF) option(WITH_BENCHMARKS "Build test/benchmarks" OFF) option(WITH_BENCHMARK_APPS "Build application benchmarks" OFF) @@ -127,7 +126,6 @@ option(INSTALL_UTILS "Copy minigzip and minideflate during install" OFF) mark_as_advanced(FORCE ZLIB_SYMBOL_PREFIX - ZLIB_DUAL_LINK WITH_REDUCED_MEM WITH_ACLE WITH_NEON WITH_DFLTCC_DEFLATE @@ -1161,7 +1159,6 @@ endif() add_feature_info(WITH_GZFILEOP WITH_GZFILEOP "Compile with support for gzFile related functions") add_feature_info(ZLIB_COMPAT ZLIB_COMPAT "Compile with zlib compatible API") add_feature_info(ZLIB_ENABLE_TESTS ZLIB_ENABLE_TESTS "Build test binaries") -add_feature_info(ZLIB_DUAL_LINK ZLIB_DUAL_LINK "Dual link tests against system zlib") add_feature_info(WITH_SANITIZER WITH_SANITIZER "Enable sanitizer support") add_feature_info(WITH_FUZZERS WITH_FUZZERS "Build test/fuzz") add_feature_info(WITH_BENCHMARKS WITH_BENCHMARKS "Build test/benchmarks") diff --git a/README.md b/README.md index 1efe7f2f..ab12fa34 100644 --- a/README.md +++ b/README.md @@ -193,7 +193,6 @@ Advanced Build Options | CMake | configure | Description | Default | |:--------------------------------|:----------------------|:--------------------------------------------------------------------|------------------------| -| ZLIB_DUAL_LINK | | Dual link tests with system zlib | OFF | | FORCE_SSE2 | --force-sse2 | Skip runtime check for SSE2 instructions (Always on for x86_64) | OFF (x86) | | FORCE_TZCNT | --force-tzcnt | Skip runtime check for TZCNT instructions | OFF | | WITH_AVX2 | | Build with AVX2 intrinsics | ON | diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index be508f61..29658422 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -180,19 +180,14 @@ else() -fsanitize-memory-track-origins) endif() - if(ZLIB_DUAL_LINK AND NOT ZLIB_COMPAT) - find_package(ZLIB) - if(ZLIB_FOUND) - message(STATUS "Added dual linking tests against zlib") - message(STATUS " Zlib include dir: ${ZLIB_INCLUDE_DIR}") - message(STATUS " Zlib libraries: ${ZLIB_LIBRARIES}") - - target_sources(gtest_zlib PRIVATE test_compress_dual.cc) - target_include_directories(gtest_zlib PRIVATE ${ZLIB_INCLUDE_DIR}) - target_link_libraries(gtest_zlib ${ZLIB_LIBRARIES}) - else() - message(WARNING "Zlib not found, skipping dual linking tests") - endif() + if(NOT ZLIB_COMPAT AND DEFINED ZLIB_INCLUDE_DIR AND DEFINED ZLIB_LIBRARIES) + message(STATUS "Added dual linking tests against zlib") + message(STATUS " Zlib include dir: ${ZLIB_INCLUDE_DIR}") + message(STATUS " Zlib libraries: ${ZLIB_LIBRARIES}") + + target_sources(gtest_zlib PRIVATE test_compress_dual.cc) + target_include_directories(gtest_zlib PRIVATE ${ZLIB_INCLUDE_DIR}) + target_link_libraries(gtest_zlib ${ZLIB_LIBRARIES}) endif() target_link_libraries(gtest_zlib zlibstatic GTest::GTest)