CMake: Fix the build when XZ_TOOL_LZMADEC=OFF

Co-developed-by: 榆柳松 (ZhengSen Wang) <wzhengsen@gmail.com>
Fixes: fb50c6ba1d
Fixes: https://github.com/tukaani-project/xz/pull/134
This commit is contained in:
Lasse Collin 2024-08-22 14:06:16 +03:00
parent 5e37598750
commit acdf21033a
1 changed files with 4 additions and 2 deletions

View 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.