Skip to content

Commit cc65147

Browse files
committed
[lldb] Fix linux build when LLDB_ENABLE_PYTHON is OFF
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 71e3047 commit cc65147

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

lldb/cmake/modules/LLDBConfig.cmake

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ add_optional_dependency(LLDB_ENABLE_LIBEDIT "Enable editline support in LLDB" Li
7171
add_optional_dependency(LLDB_ENABLE_CURSES "Enable curses support in LLDB" CursesAndPanel CURSESANDPANEL_FOUND)
7272
add_optional_dependency(LLDB_ENABLE_LZMA "Enable LZMA compression support in LLDB" LibLZMA LIBLZMA_FOUND)
7373
add_optional_dependency(LLDB_ENABLE_LUA "Enable Lua scripting support in LLDB" LuaAndSwig LUAANDSWIG_FOUND)
74-
add_optional_dependency(LLDB_ENABLE_PYTHON "Enable Python scripting support in LLDB" PythonAndSwig PYTHONANDSWIG_FOUND)
74+
# Python is needed to generate SBLanguages.h from Dwarf.def, so we cannot just
75+
# skip it as a dependency if LLDB_ENABLE_PYTHON is false.
76+
add_optional_dependency(ON "Enable Python scripting support in LLDB" PythonAndSwig PYTHONANDSWIG_FOUND)
7577
add_optional_dependency(LLDB_ENABLE_LIBXML2 "Enable Libxml 2 support in LLDB" LibXml2 LIBXML2_FOUND VERSION ${LLDB_LIBXML2_VERSION})
7678
add_optional_dependency(LLDB_ENABLE_FBSDVMCORE "Enable libfbsdvmcore support in LLDB" FBSDVMCore FBSDVMCore_FOUND QUIET)
7779

@@ -215,6 +217,15 @@ else()
215217
# Even if Python scripting is disabled, we still need a Python interpreter to
216218
# build, for example to generate SBLanguages.h.
217219
find_package(Python3 COMPONENTS Interpreter REQUIRED)
220+
221+
# Remove lldb-python-scripts from distribution components.
222+
# LLVM_DISTRIBUTION_COMPONENTS is set in a cache where LLDB_ENABLE_PYTHON does
223+
# not yet have a value. We have to touch up LLVM_DISTRIBUTION_COMPONENTS after
224+
# the fact.
225+
if(LLVM_DISTRIBUTION_COMPONENTS)
226+
list(REMOVE_ITEM LLVM_DISTRIBUTION_COMPONENTS lldb-python-scripts)
227+
set(LLVM_DISTRIBUTION_COMPONENTS ${LLVM_DISTRIBUTION_COMPONENTS} CACHE STRING "" FORCE)
228+
endif()
218229
endif()
219230

220231
if (LLVM_EXTERNAL_CLANG_SOURCE_DIR)

0 commit comments

Comments
 (0)