diff options
| author | Nathan Moinvaziri <nathan@nathanm.com> | 2020-05-01 20:01:43 -0700 |
|---|---|---|
| committer | Hans Kristian Rosbach <hk-github@circlestorm.org> | 2020-05-06 09:46:28 +0200 |
| commit | d599d9d222db7569f24e7c579f87133ce49510bb (patch) | |
| tree | e05d3d683e4ba47234ac76a3cc716c87a0838233 | |
| parent | e3c858c2c71b34bd5b76b57cbcfbf551fa52c464 (diff) | |
| download | Project-Tick-d599d9d222db7569f24e7c579f87133ce49510bb.tar.gz Project-Tick-d599d9d222db7569f24e7c579f87133ce49510bb.zip | |
Added CI test for dual linking zlib-ng with system zlib.
| -rw-r--r-- | .github/workflows/cmake.yml | 6 | ||||
| -rw-r--r-- | CMakeLists.txt | 9 | ||||
| -rw-r--r-- | README.md | 1 |
3 files changed, 15 insertions, 1 deletions
diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 45d105e9a4..8540b96ab1 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -10,6 +10,7 @@ jobs: name: [ Ubuntu 18.04 GCC, Ubuntu 18.04 GCC OSB -O1, + Ubuntu 18.04 GCC Link Zlib, Ubuntu 18.04 GCC No AVX2, Ubuntu 18.04 GCC No SSE2, Ubuntu 18.04 GCC No SSE4, @@ -65,6 +66,11 @@ jobs: codecov: ubuntu_gcc_osb cflags: -O1 -g3 + - name: Ubuntu 18.04 GCC Link Zlib + os: ubuntu-18.04 + compiler: gcc + cmake-args: -DZLIB_LINK_SYSLIB=ON + - name: Ubuntu 18.04 GCC No AVX2 os: ubuntu-18.04 compiler: gcc diff --git a/CMakeLists.txt b/CMakeLists.txt index 14a5bef615..5d186440d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,6 +81,7 @@ check_include_file(sys/sdt.h HAVE_SYS_SDT_H) option(WITH_GZFILEOP "Compile with support for gzFile related functions" OFF) 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_SANITIZERS "Build with address sanitizer and all supported sanitizers other than memory sanitizer" OFF) option(WITH_MSAN "Build with memory sanitizer" OFF) option(WITH_FUZZERS "Build test/fuzz" OFF) @@ -106,7 +107,7 @@ elseif(BASEARCH_X86_FOUND) option(WITH_PCLMULQDQ "Build with PCLMULQDQ" ON) endif() -mark_as_advanced(FORCE WITH_ACLE WITH_NEON WITH_DFLTCC_DEFLATE WITH_DFLTCC_INFLATE +mark_as_advanced(FORCE ZLIB_DUAL_LINK WITH_ACLE WITH_NEON WITH_DFLTCC_DEFLATE WITH_DFLTCC_INFLATE WITH_AVX2 WITH_SSE2 WITH_SSE4 WITH_PCLMULQDQ WITH_INFLATE_STRICT WITH_INFLATE_ALLOW_INVALID_DIST) add_feature_info(ZLIB_COMPAT ZLIB_COMPAT "Provide a zlib-compatible API") @@ -950,6 +951,12 @@ if (ZLIB_ENABLE_TESTS) target_compile_definitions(${target} PUBLIC -DWITH_GZFILEOP) target_sources(${target} PRIVATE ${ZLIB_GZFILE_SRCS}) endif() + if(ZLIB_DUAL_LINK) + find_package(ZLIB) + if(ZLIB_FOUND) + target_link_libraries(minigzip ${ZLIB_LIBRARIES}) + endif() + endif() endmacro() add_executable(example test/example.c) @@ -168,6 +168,7 @@ Advanced Build Options | CMake | configure | Description | Default | |:--------------------------------|:----------------------|:--------------------------------------------------------------------|------------------------| +| ZLIB_DUAL_LINK | | Dual link tests with system zlib | OFF | | UNALIGNED_OK | | Allow unaligned reads | ON (x86, arm) | | | --force-sse2 | Assume SSE2 instructions are always available | ON (x86), OFF (x86_64) | | WITH_AVX2 | | Build with AVX2 intrinsics | ON | |
