Skip to content

Commit 9922b10

Browse files
committed
[lldb] Fix Linux build when LLDB_ENABLE_PYTHON is OFF (llvm#159825)
Remove 'lldb-python-scripts' from LLVM_DISTRIBUTION_COMPONENTS when Python scripting is disabled. Otherwise we get ``` Specified distribution component 'lldb-python-scripts' doesn't have an install target ``` (cherry picked from commit 1688011)
1 parent 71e3047 commit 9922b10

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lldb/cmake/modules/LLDBConfig.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,15 @@ else()
215215
# Even if Python scripting is disabled, we still need a Python interpreter to
216216
# build, for example to generate SBLanguages.h.
217217
find_package(Python3 COMPONENTS Interpreter REQUIRED)
218+
219+
# Remove lldb-python-scripts from distribution components.
220+
# LLVM_DISTRIBUTION_COMPONENTS is set in a cache where LLDB_ENABLE_PYTHON does
221+
# not yet have a value. We have to touch up LLVM_DISTRIBUTION_COMPONENTS after
222+
# the fact.
223+
if(LLVM_DISTRIBUTION_COMPONENTS)
224+
list(REMOVE_ITEM LLVM_DISTRIBUTION_COMPONENTS lldb-python-scripts)
225+
set(LLVM_DISTRIBUTION_COMPONENTS ${LLVM_DISTRIBUTION_COMPONENTS} CACHE STRING "" FORCE)
226+
endif()
218227
endif()
219228

220229
if (LLVM_EXTERNAL_CLANG_SOURCE_DIR)

0 commit comments

Comments
 (0)