From acdf21033abe347d9a279e9fe757f90ed16c1dbb Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Thu, 22 Aug 2024 14:06:16 +0300 Subject: [PATCH] CMake: Fix the build when XZ_TOOL_LZMADEC=OFF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-developed-by: 榆柳松 (ZhengSen Wang) Fixes: fb50c6ba1d4c9405e5b12b5988b01a3002638c5d Fixes: https://github.com/tukaani-project/xz/pull/134 --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 40da486e..995cae6e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1868,8 +1868,10 @@ if(HAVE_DECODERS) COMPONENT "${XZDEC}_Runtime") endforeach() - # This is the only build-time difference with lzmadec. - target_compile_definitions(lzmadec PRIVATE "LZMADEC") + if(XZ_TOOL_LZMADEC) + # This is the only build-time difference with lzmadec. + target_compile_definitions(lzmadec PRIVATE "LZMADEC") + endif() if(UNIX) # NOTE: This puts the lzmadec.1 symlinks into xzdec_Documentation.