Skip to content

Commit 1688011

Browse files
[lldb] Fix Linux build when LLDB_ENABLE_PYTHON is OFF (#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 ```
1 parent bbf657d commit 1688011

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
@@ -191,6 +191,15 @@ else()
191191
# Even if Python scripting is disabled, we still need a Python interpreter to
192192
# build, for example to generate SBLanguages.h.
193193
find_package(Python3 COMPONENTS Interpreter REQUIRED)
194+
195+
# Remove lldb-python-scripts from distribution components.
196+
# LLVM_DISTRIBUTION_COMPONENTS is set in a cache where LLDB_ENABLE_PYTHON does
197+
# not yet have a value. We have to touch up LLVM_DISTRIBUTION_COMPONENTS after
198+
# the fact.
199+
if(LLVM_DISTRIBUTION_COMPONENTS)
200+
list(REMOVE_ITEM LLVM_DISTRIBUTION_COMPONENTS lldb-python-scripts)
201+
set(LLVM_DISTRIBUTION_COMPONENTS ${LLVM_DISTRIBUTION_COMPONENTS} CACHE STRING "" FORCE)
202+
endif()
194203
endif()
195204

196205
if (LLVM_EXTERNAL_CLANG_SOURCE_DIR)

0 commit comments

Comments
 (0)