diff options
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | Help/cpack_gen/archive.rst | 7 | ||||
-rw-r--r-- | Help/release/dev/lzma-threads.rst | 7 | ||||
-rw-r--r-- | Modules/CPack.cmake | 7 | ||||
-rw-r--r-- | Utilities/cmliblzma/CMakeLists.txt | 12 | ||||
-rw-r--r-- | Utilities/cmliblzma/liblzma/common/common.h | 1 |
6 files changed, 29 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 045a283..4f03c39 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() diff --git a/Help/cpack_gen/archive.rst b/Help/cpack_gen/archive.rst index b941812..47e8e13 100644 --- a/Help/cpack_gen/archive.rst +++ b/Help/cpack_gen/archive.rst @@ -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. diff --git a/Help/release/dev/lzma-threads.rst b/Help/release/dev/lzma-threads.rst new file mode 100644 index 0000000..a481cfa --- /dev/null +++ b/Help/release/dev/lzma-threads.rst @@ -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. diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake index ef5a7d5..3b29ede 100644 --- a/Modules/CPack.cmake +++ b/Modules/CPack.cmake @@ -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 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/Utilities/cmliblzma/CMakeLists.txt b/Utilities/cmliblzma/CMakeLists.txt index 5dd7035..4820a8f 100644 --- a/Utilities/cmliblzma/CMakeLists.txt +++ b/Utilities/cmliblzma/CMakeLists.txt @@ -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 diff --git a/Utilities/cmliblzma/liblzma/common/common.h b/Utilities/cmliblzma/liblzma/common/common.h index dde3ae0..b3d3b7a 100644 --- a/Utilities/cmliblzma/liblzma/common/common.h +++ b/Utilities/cmliblzma/liblzma/common/common.h @@ -14,6 +14,7 @@ #define LZMA_COMMON_H #include "sysdefs.h" +#include "mythread.h" #include "tuklib_integer.h" #if defined(_WIN32) || defined(__CYGWIN__) |