[Lldb-commits] [PATCH] D138879: [lldb] Make SWIG an autodetected depenency

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Nov 29 09:07:31 PST 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rGb3c978e850d3: [lldb] Make SWIG an auto-detected dependency (authored by JDevlieghere).
Herald added a project: LLDB.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138879/new/

https://reviews.llvm.org/D138879

Files:
  lldb/cmake/modules/FindLuaAndSwig.cmake
  lldb/cmake/modules/FindPythonAndSwig.cmake
  lldb/cmake/modules/LLDBConfig.cmake


Index: lldb/cmake/modules/LLDBConfig.cmake
===================================================================
--- lldb/cmake/modules/LLDBConfig.cmake
+++ lldb/cmake/modules/LLDBConfig.cmake
@@ -56,6 +56,7 @@
   message(STATUS "${description}: ${${variable}}")
 endmacro()
 
+add_optional_dependency(LLDB_ENABLE_SWIG "Enable SWIG to generate LLDB bindings" SWIG SWIG_FOUND VERSION 3)
 add_optional_dependency(LLDB_ENABLE_LIBEDIT "Enable editline support in LLDB" LibEdit LibEdit_FOUND)
 add_optional_dependency(LLDB_ENABLE_CURSES "Enable curses support in LLDB" CursesAndPanel CURSESANDPANEL_FOUND)
 add_optional_dependency(LLDB_ENABLE_LZMA "Enable LZMA compression support in LLDB" LibLZMA LIBLZMA_FOUND)
Index: lldb/cmake/modules/FindPythonAndSwig.cmake
===================================================================
--- lldb/cmake/modules/FindPythonAndSwig.cmake
+++ lldb/cmake/modules/FindPythonAndSwig.cmake
@@ -38,9 +38,8 @@
 if(Python3_LIBRARIES AND Python3_INCLUDE_DIRS AND Python3_EXECUTABLE AND SWIG_EXECUTABLE)
   set(PYTHONANDSWIG_FOUND TRUE)
 else()
-  find_package(SWIG 3.0)
-  if (SWIG_FOUND)
-      FindPython3()
+  if (LLDB_ENABLE_SWIG)
+    FindPython3()
   else()
     message(STATUS "SWIG 3 or later is required for Python support in LLDB but could not be found")
   endif()
@@ -64,5 +63,5 @@
                                       Python3_LIBRARIES
                                       Python3_INCLUDE_DIRS
                                       Python3_EXECUTABLE
-                                      SWIG_EXECUTABLE)
+                                      LLDB_ENABLE_SWIG)
 endif()
Index: lldb/cmake/modules/FindLuaAndSwig.cmake
===================================================================
--- lldb/cmake/modules/FindLuaAndSwig.cmake
+++ lldb/cmake/modules/FindLuaAndSwig.cmake
@@ -7,8 +7,7 @@
 if(LUA_LIBRARIES AND LUA_INCLUDE_DIR AND SWIG_EXECUTABLE)
   set(LUAANDSWIG_FOUND TRUE)
 else()
-  find_package(SWIG 3.0)
-  if (SWIG_FOUND)
+  if (LLDB_ENABLE_SWIG)
     find_package(Lua 5.3 EXACT)
     if(LUA_FOUND AND SWIG_FOUND)
       mark_as_advanced(
@@ -20,6 +19,7 @@
     message(STATUS "SWIG 3 or later is required for Lua support in LLDB but could not be found")
   endif()
 
+
   include(FindPackageHandleStandardArgs)
   find_package_handle_standard_args(LuaAndSwig
                                     FOUND_VAR
@@ -27,5 +27,5 @@
                                     REQUIRED_VARS
                                       LUA_LIBRARIES
                                       LUA_INCLUDE_DIR
-                                      SWIG_EXECUTABLE)
+                                      LLDB_ENABLE_SWIG)
 endif()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138879.478622.patch
Type: text/x-patch
Size: 2660 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20221129/ff657c21/attachment-0001.bin>


More information about the lldb-commits mailing list