[lldb] Make SWIG an auto-detected dependency

This patch makes SWIG itself an auto-detected dependency. This allows us
to look for SWIG once in a centralized place and makes it easier
downstream to detect whether to use the static bindings.

Differential revision: https://reviews.llvm.org/D138879
This commit is contained in:
Jonas Devlieghere 2022-11-29 08:46:21 -08:00
parent dbb1130966
commit b3c978e850
No known key found for this signature in database
GPG Key ID: 49CC0BD90FDEED4D
3 changed files with 7 additions and 7 deletions

View File

@ -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 @@ else()
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 @@ else()
REQUIRED_VARS
LUA_LIBRARIES
LUA_INCLUDE_DIR
SWIG_EXECUTABLE)
LLDB_ENABLE_SWIG)
endif()

View File

@ -38,9 +38,8 @@ endmacro()
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 @@ else()
Python3_LIBRARIES
Python3_INCLUDE_DIRS
Python3_EXECUTABLE
SWIG_EXECUTABLE)
LLDB_ENABLE_SWIG)
endif()

View File

@ -56,6 +56,7 @@ macro(add_optional_dependency variable description package found)
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)