zstd: Enable multithreading support in build within CMake

Since commit cbf71b21b2 (cli tar: support multithreading compression,
2025-11-28, v4.3.0-rc1~393^2~1) we offer command-line options to control
compression threading.  Enable them when used with Zstd.

On AIX this causes allocation failures similar to those we avoid via
commit 1ba3444fd8 (libarchive: Limit 7zip and zstd compression level to
6 on AIX, 2025-12-11, v4.3.0-rc1~335^2~1), so leave threading off there
pending further investigation.

Issue: #27712
This commit is contained in:
Brad King
2026-03-23 12:19:58 -04:00
parent 0de3ac7670
commit f278888171

View File

@@ -53,4 +53,11 @@ target_compile_definitions(cmzstd PRIVATE
ZSTD_DISABLE_ASM=1
)
if(NOT CMAKE_SYSTEM_NAME STREQUAL "AIX")
target_compile_definitions(cmzstd PRIVATE
# Enable threaded compression.
ZSTD_MULTITHREAD
)
endif()
install(FILES LICENSE DESTINATION ${CMake_INSTALL_DOC_DIR}/cmzstd)