1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-15 03:48:02 +08:00

liblzma: Enable multi threaded stream encoding support

This commit is contained in:
Nils Gladitz
2021-04-16 18:03:22 +02:00
committed by Brad King
parent e9065e96dc
commit 5380d858ff
6 changed files with 29 additions and 6 deletions

View File

@@ -579,6 +579,7 @@ macro (CMAKE_BUILD_UTILITIES)
set(LIBLZMA_INCLUDE_DIR
"${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmliblzma/liblzma/api")
set(LIBLZMA_LIBRARY cmliblzma)
set(HAVE_LZMA_STREAM_ENCODER_MT 1)
endif()
endif()

View File

@@ -82,7 +82,8 @@ CPack generators which are essentially archives at their core. These include:
See also the :variable:`CPACK_THREADS` variable.
.. note::
.. versionadded:: 3.21
Official CMake binaries available on ``cmake.org`` ship with a ``liblzma``
that does not support parallel compression.
Official CMake binaries available on ``cmake.org`` now ship
with a ``liblzma`` that supports parallel compression.
Older versions did not.

View File

@@ -0,0 +1,7 @@
lzma-threads
------------
* The precompiled binaries provided on
`cmake.org <https://cmake.org/download/>`_ now support
``liblzma`` multi-threading. See the :variable:`CPACK_THREADS` and
:variable:`CPACK_ARCHIVE_THREADS` variables.

View File

@@ -299,10 +299,11 @@ installers. The most commonly-used variables are:
Currently only ``xz`` compression *may* take advantage of multiple cores. Other
compression methods ignore this value and use only one thread.
.. note::
.. versionadded:: 3.21
Official CMake binaries available on ``cmake.org`` ship with a ``liblzma``
that does not support parallel compression.
Official CMake binaries available on ``cmake.org`` now ship
with a ``liblzma`` that supports parallel compression.
Older versions did not.
Variables for Source Package Generators
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@@ -6,6 +6,12 @@ include(CheckSymbolExists)
include(CheckTypeSize)
include(TestBigEndian)
if(WIN32)
add_definitions(-DMYTHREAD_VISTA)
else()
add_definitions(-DMYTHREAD_POSIX)
endif()
CHECK_INCLUDE_FILE(byteswap.h HAVE_BYTESWAP_H)
CHECK_INCLUDE_FILE(limits.h HAVE_LIMITS_H)
CHECK_INCLUDE_FILE(memory.h HAVE_MEMORY_H)
@@ -60,7 +66,10 @@ set(HAVE_MF_HC3 1)
set(HAVE_MF_HC4 1)
SET(LZMA_SRCS
common/mythread.h
common/sysdefs.h
common/tuklib_cpucores.c
common/tuklib_cpucores.h
common/tuklib_integer.h
liblzma/check/check.c
liblzma/check/crc32_fast.c
@@ -91,14 +100,17 @@ SET(LZMA_SRCS
liblzma/common/filter_encoder.c
liblzma/common/filter_flags_decoder.c
liblzma/common/filter_flags_encoder.c
liblzma/common/hardware_cputhreads.c
liblzma/common/index.c
liblzma/common/index_decoder.c
liblzma/common/index_encoder.c
liblzma/common/index_hash.c
liblzma/common/outqueue.c
liblzma/common/stream_buffer_decoder.c
liblzma/common/stream_buffer_encoder.c
liblzma/common/stream_decoder.c
liblzma/common/stream_encoder.c
liblzma/common/stream_encoder_mt.c
liblzma/common/stream_flags_common.c
liblzma/common/stream_flags_decoder.c
liblzma/common/stream_flags_encoder.c

View File

@@ -14,6 +14,7 @@
#define LZMA_COMMON_H
#include "sysdefs.h"
#include "mythread.h"
#include "tuklib_integer.h"
#if defined(_WIN32) || defined(__CYGWIN__)