summaryrefslogtreecommitdiff
path: root/lldb/cmake
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2022-11-29 08:46:21 -0800
committerJonas Devlieghere <jonas@devlieghere.com>2022-11-29 09:07:11 -0800
commitb3c978e850d374438697f8b79b5e28ab51310068 (patch)
tree7de0ed2b3b449489d0bd7928201d260d4269afd5 /lldb/cmake
parentdbb11309665fdf7d411d25cc8f2e6a0c8f658143 (diff)
downloadllvm-b3c978e850d374438697f8b79b5e28ab51310068.tar.gz
[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
Diffstat (limited to 'lldb/cmake')
-rw-r--r--lldb/cmake/modules/FindLuaAndSwig.cmake6
-rw-r--r--lldb/cmake/modules/FindPythonAndSwig.cmake7
-rw-r--r--lldb/cmake/modules/LLDBConfig.cmake1
3 files changed, 7 insertions, 7 deletions
diff --git a/lldb/cmake/modules/FindLuaAndSwig.cmake b/lldb/cmake/modules/FindLuaAndSwig.cmake
index 982616169a05..dd51ea1ef4c1 100644
--- a/lldb/cmake/modules/FindLuaAndSwig.cmake
+++ b/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 @@ 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()
diff --git a/lldb/cmake/modules/FindPythonAndSwig.cmake b/lldb/cmake/modules/FindPythonAndSwig.cmake
index 3535b548c45f..1b7e1657e364 100644
--- a/lldb/cmake/modules/FindPythonAndSwig.cmake
+++ b/lldb/cmake/modules/FindPythonAndSwig.cmake
@@ -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()
diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake
index 1079e4b2def1..f3f1103d244f 100644
--- a/lldb/cmake/modules/LLDBConfig.cmake
+++ b/lldb/cmake/modules/LLDBConfig.cmake
@@ -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)