diff options
author | Russell Greene <russellgreene8@gmail.com> | 2022-02-17 22:12:16 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-02-23 13:39:32 (GMT) |
commit | 525faec4e9d7a25431504d6fe47313f1478b26e9 (patch) | |
tree | e072d26d49d5c3222dabf6e2280ef8a485d4a8a8 | |
parent | 215c4efd3ef620233c42530d4b237f60e9876958 (diff) | |
download | CMake-525faec4e9d7a25431504d6fe47313f1478b26e9.zip CMake-525faec4e9d7a25431504d6fe47313f1478b26e9.tar.gz CMake-525faec4e9d7a25431504d6fe47313f1478b26e9.tar.bz2 |
CPack: Add parallel zstd compression
-rw-r--r-- | Help/release/dev/cpack-zstd-parallel.rst | 6 | ||||
-rw-r--r-- | Modules/CPack.cmake | 6 | ||||
-rw-r--r-- | Source/cmArchiveWrite.cxx | 9 |
3 files changed, 21 insertions, 0 deletions
diff --git a/Help/release/dev/cpack-zstd-parallel.rst b/Help/release/dev/cpack-zstd-parallel.rst new file mode 100644 index 0000000..da22625 --- /dev/null +++ b/Help/release/dev/cpack-zstd-parallel.rst @@ -0,0 +1,6 @@ +cpack-zstd-parallel +------------------- + +* CPack now supports the :variable:`CPACK_THREADS` option for ``zstd`` + compression when compiled with libarchive 3.6 or higher. It is + supported by official CMake binaries available on ``cmake.org``. diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake index e267ed0..5a22be5 100644 --- a/Modules/CPack.cmake +++ b/Modules/CPack.cmake @@ -316,6 +316,12 @@ installers. The most commonly-used variables are: with a ``liblzma`` that supports parallel compression. Older versions did not. + ``zstd`` + .. versionadded:: 3.24 + + Supported if CMake is built with libarchive 3.6 or higher. + Official CMake binaries available on ``cmake.org`` support it. + Other compression methods ignore this value and use only one thread. Variables for Source Package Generators diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx index 31a2a5a..cfde37c 100644 --- a/Source/cmArchiveWrite.cxx +++ b/Source/cmArchiveWrite.cxx @@ -188,6 +188,15 @@ cmArchiveWrite::cmArchiveWrite(std::ostream& os, Compress c, cm_archive_error_string(this->Archive)); return; } + +#if ARCHIVE_VERSION_NUMBER >= 3006000 + if (archive_write_set_filter_option(this->Archive, "zstd", "threads", + sNumThreads.c_str()) != ARCHIVE_OK) { + this->Error = cmStrCat("archive_compressor_zstd_options: ", + cm_archive_error_string(this->Archive)); + return; + } +#endif break; } |