From ebf7e96e2c04f3ccf860d165cecfe3300a973026 Mon Sep 17 00:00:00 2001 From: Nathan Moinvaziri Date: Thu, 18 Jun 2020 20:31:25 -0700 Subject: [PATCH] Add options to install minigzip and minideflate. --- .github/workflows/release.yml | 2 +- CMakeLists.txt | 9 +++++++++ README.md | 3 ++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6a5dde934..56ef3e3ca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -51,7 +51,7 @@ jobs: - name: Generate project files run: | - cmake . ${{ matrix.cmake-args }} -DCMAKE_BUILD_TYPE=Release -DWITH_GZFILEOP=ON -DZLIB_ENABLE_TESTS=ON -DCMAKE_INSTALL_PREFIX=out + cmake . ${{ matrix.cmake-args }} -DCMAKE_BUILD_TYPE=Release -DWITH_GZFILEOP=ON -DZLIB_ENABLE_TESTS=ON -DCMAKE_INSTALL_PREFIX=out -DINSTALL_UTILS=ON env: CC: ${{ matrix.compiler }} CI: true diff --git a/CMakeLists.txt b/CMakeLists.txt index aeaa1447f..777a2c66f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -103,6 +103,7 @@ elseif(BASEARCH_X86_FOUND) option(WITH_SSE4 "Build with SSE4" ON) option(WITH_PCLMULQDQ "Build with PCLMULQDQ" ON) endif() +option(INSTALL_UTILS "Copy minigzip and minideflate during install" OFF) mark_as_advanced(FORCE ZLIB_DUAL_LINK @@ -115,6 +116,7 @@ mark_as_advanced(FORCE WITH_POWER8 WITH_INFLATE_STRICT WITH_INFLATE_ALLOW_INVALID_DIST + INSTALL_UTILS ) add_feature_info(ZLIB_COMPAT ZLIB_COMPAT "Provide a zlib-compatible API") @@ -1042,6 +1044,13 @@ if(ZLIB_ENABLE_TESTS) configure_test_executable(minideflate) target_link_libraries(minideflate zlib) + if(INSTALL_UTILS) + install(TARGETS minigzip minideflate + RUNTIME DESTINATION "${INSTALL_BIN_DIR}" + ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" + LIBRARY DESTINATION "${INSTALL_LIB_DIR}") + endif() + add_executable(switchlevels test/switchlevels.c) configure_test_executable(switchlevels) target_link_libraries(switchlevels zlib) diff --git a/README.md b/README.md index 1873b3735..9324769c7 100644 --- a/README.md +++ b/README.md @@ -200,8 +200,9 @@ Advanced Build Options | WITH_PCLMULQDQ | | Build with PCLMULQDQ intrinsics | ON | | WITH_ACLE | --without-acle | Build with ACLE intrinsics | ON | | WITH_NEON | --without-neon | Build with NEON intrinsics | ON | -| WITH_POWER8 | | Build with POWER8 optimisations | ON +| WITH_POWER8 | | Build with POWER8 optimisations | ON | | WITH_DFLTCC_DEFLATE | --with-dfltcc-deflate | Use DEFLATE COMPRESSION CALL instruction for compression on IBM Z | OFF | | WITH_DFLTCC_INFLATE | --with-dfltcc-inflate | Use DEFLATE COMPRESSION CALL instruction for decompression on IBM Z | OFF | | WITH_INFLATE_STRICT | | Build with strict inflate distance checking | OFF | | WITH_INFLATE_ALLOW_INVALID_DIST | | Build with zero fill for inflate invalid distances | OFF | +| INSTALL_UTILS | | Copy minigzip and minigzip during install | OFF | -- 2.47.3