https://github.com/AnthonyLatsis created 
https://github.com/llvm/llvm-project/pull/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
```

>From 17dc924c0cb6a81492933ae8260a0ad529c978db Mon Sep 17 00:00:00 2001
From: Anthony Latsis <alat...@apple.com>
Date: Mon, 8 Sep 2025 05:06:35 +0100
Subject: [PATCH] [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
```
---
 lldb/cmake/modules/LLDBConfig.cmake | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lldb/cmake/modules/LLDBConfig.cmake 
b/lldb/cmake/modules/LLDBConfig.cmake
index 90db786a2b6e9..4b568d27c4709 100644
--- a/lldb/cmake/modules/LLDBConfig.cmake
+++ b/lldb/cmake/modules/LLDBConfig.cmake
@@ -191,6 +191,15 @@ else()
   # Even if Python scripting is disabled, we still need a Python interpreter to
   # build, for example to generate SBLanguages.h.
   find_package(Python3 COMPONENTS Interpreter REQUIRED)
+
+  # Remove lldb-python-scripts from distribution components.
+  # LLVM_DISTRIBUTION_COMPONENTS is set in a cache where LLDB_ENABLE_PYTHON 
does
+  # not yet have a value. We have to touch up LLVM_DISTRIBUTION_COMPONENTS 
after
+  # the fact.
+  if(LLVM_DISTRIBUTION_COMPONENTS)
+    list(REMOVE_ITEM LLVM_DISTRIBUTION_COMPONENTS lldb-python-scripts)
+    set(LLVM_DISTRIBUTION_COMPONENTS ${LLVM_DISTRIBUTION_COMPONENTS} CACHE 
STRING "" FORCE)
+  endif()
 endif()
 
 if (LLVM_EXTERNAL_CLANG_SOURCE_DIR)

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to