diff options
-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; } |