aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJia Tan <jiat0218@gmail.com>2023-03-21 23:36:00 +0800
committerJia Tan <jiat0218@gmail.com>2023-03-23 21:48:52 +0800
commitb0891684b4436aed31510fddcbb218d513bd5489 (patch)
tree5155d19aa551639a34d3e8c0a0fd40d75733df9b
parentCMake: Allow configuring features as cache variables. (diff)
downloadxz-b0891684b4436aed31510fddcbb218d513bd5489.tar.xz
CMake: Conditionally build xz list.* files if decoders are enabled.
-rw-r--r--CMakeLists.txt9
1 files changed, 7 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index db429560..b4a9e5d1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -958,8 +958,6 @@ if(NOT MSVC AND HAVE_GETOPT_LONG)
src/xz/file_io.h
src/xz/hardware.c
src/xz/hardware.h
- src/xz/list.c
- src/xz/list.h
src/xz/main.c
src/xz/main.h
src/xz/message.c
@@ -982,6 +980,13 @@ if(NOT MSVC AND HAVE_GETOPT_LONG)
src/liblzma/api
)
+ if(HAVE_DECODERS)
+ target_sources(xz PRIVATE
+ src/xz/list.c
+ src/xz/list.h
+ )
+ endif()
+
target_link_libraries(xz PRIVATE liblzma)
target_compile_definitions(xz PRIVATE ASSUME_RAM=128)