https://github.com/JDevlieghere created 
https://github.com/llvm/llvm-project/pull/183236

Limit Python include dir to ScriptInterpreterPython and any library that 
depends on it (i.e. liblldb), making it consistent with what we do for Lua.

>From d61896eab11b73b9beb2cbb441cbf2f4d017d6c2 Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere <[email protected]>
Date: Tue, 24 Feb 2026 20:52:05 -0800
Subject: [PATCH] [lldb] Limit Python include dir to ScriptInterpreterPython
 (NFC)

Limit Python include dir to ScriptInterpreterPython and any library that
depends on it (i.e. liblldb), making it consistent with what we do for
Lua.
---
 lldb/cmake/modules/LLDBConfig.cmake                         | 2 --
 lldb/source/Plugins/ScriptInterpreter/Lua/CMakeLists.txt    | 5 +++--
 lldb/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt | 4 ++++
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/lldb/cmake/modules/LLDBConfig.cmake 
b/lldb/cmake/modules/LLDBConfig.cmake
index 6ce4853cf4a44..42af86b57cfcc 100644
--- a/lldb/cmake/modules/LLDBConfig.cmake
+++ b/lldb/cmake/modules/LLDBConfig.cmake
@@ -173,8 +173,6 @@ if (LLDB_ENABLE_PYTHON)
     "Embed PYTHONHOME in the binary. If set to OFF, PYTHONHOME environment 
variable will be used to to locate Python."
     ${default_embed_python_home})
 
-  include_directories(${Python3_INCLUDE_DIRS})
-
   if (LLDB_EMBED_PYTHON_HOME)
     get_filename_component(PYTHON_HOME "${Python3_EXECUTABLE}" DIRECTORY)
     set(LLDB_PYTHON_HOME "${PYTHON_HOME}" CACHE STRING
diff --git a/lldb/source/Plugins/ScriptInterpreter/Lua/CMakeLists.txt 
b/lldb/source/Plugins/ScriptInterpreter/Lua/CMakeLists.txt
index ecfc7648c7ce4..d3f3ef72a0bf9 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Lua/CMakeLists.txt
+++ b/lldb/source/Plugins/ScriptInterpreter/Lua/CMakeLists.txt
@@ -5,7 +5,8 @@ add_lldb_library(lldbPluginScriptInterpreterLua PLUGIN
   LINK_LIBS
     lldbCore
     lldbInterpreter
+    ${LUA_LIBRARIES}
   )
 
-target_include_directories(lldbPluginScriptInterpreterLua PUBLIC 
${LUA_INCLUDE_DIR})
-target_link_libraries(lldbPluginScriptInterpreterLua INTERFACE 
${LUA_LIBRARIES})
+  target_include_directories(lldbPluginScriptInterpreterLua
+    PUBLIC ${LUA_INCLUDE_DIR})
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt 
b/lldb/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt
index f2ff38530a3f2..0b3428d8856fa 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt
@@ -48,3 +48,7 @@ add_lldb_library(lldbPluginScriptInterpreterPython PLUGIN
     ${Python3_LIBRARIES}
     ${LLDB_LIBEDIT_LIBS}
   )
+
+
+  target_include_directories(lldbPluginScriptInterpreterPython
+    PUBLIC ${Python3_INCLUDE_DIRS})

_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to