]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
CMake: Fix the build when XZ_TOOL_LZMADEC=OFF
authorLasse Collin <lasse.collin@tukaani.org>
Thu, 22 Aug 2024 11:06:16 +0000 (14:06 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Mon, 2 Sep 2024 14:33:06 +0000 (17:33 +0300)
Co-developed-by: 榆柳松 (ZhengSen Wang) <wzhengsen@gmail.com>
Fixes: fb50c6ba1d4c9405e5b12b5988b01a3002638c5d
Fixes: https://github.com/tukaani-project/xz/pull/134
CMakeLists.txt

index 40da486e67232c8b0360a0b25ae148c883b4415a..995cae6e08101cc7b93db698a017de95b4dc5d26 100644 (file)
@@ -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.