Skip to content

Commit 0c8b637

Browse files
committed
[lldb] Auto-detect whether to use the static bindings
Use LLDB's auto-detection logic to determine whether the developer has a supported version of SWIG installed. Only use the static bindings if that's not the case, or the developer has explicitly set the LLDB_USE_STATIC_BINDINGS flag.
1 parent ee1744e commit 0c8b637

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

lldb/cmake/modules/FindLuaAndSwig.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,5 @@ else()
2626
LUAANDSWIG_FOUND
2727
REQUIRED_VARS
2828
LUA_LIBRARIES
29-
LUA_INCLUDE_DIR
30-
LLDB_ENABLE_SWIG)
29+
LUA_INCLUDE_DIR)
3130
endif()

lldb/cmake/modules/FindPythonAndSwig.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,5 @@ else()
6262
REQUIRED_VARS
6363
Python3_LIBRARIES
6464
Python3_INCLUDE_DIRS
65-
Python3_EXECUTABLE
66-
LLDB_ENABLE_SWIG)
65+
Python3_EXECUTABLE)
6766
endif()

lldb/cmake/modules/LLDBConfig.cmake

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,16 @@ macro(add_optional_dependency variable description package found)
5757
endmacro()
5858

5959
add_optional_dependency(LLDB_ENABLE_SWIG "Enable SWIG to generate LLDB bindings" SWIG SWIG_FOUND VERSION 3)
60+
61+
# BEGIN SWIFT MOD
62+
if (LLDB_ENABLE_SWIG)
63+
set(LLDB_ENABLE_STATIC_BINDINGS FALSE)
64+
else()
65+
set(LLDB_ENABLE_STATIC_BINDINGS TRUE)
66+
endif()
67+
option(LLDB_USE_STATIC_BINDINGS "Use the static Python bindings." ${LLDB_ENABLE_STATIC_BINDINGS})
68+
# END SWIFT MOD
69+
6070
add_optional_dependency(LLDB_ENABLE_LIBEDIT "Enable editline support in LLDB" LibEdit LibEdit_FOUND)
6171
add_optional_dependency(LLDB_ENABLE_CURSES "Enable curses support in LLDB" CursesAndPanel CURSESANDPANEL_FOUND)
6272
add_optional_dependency(LLDB_ENABLE_LZMA "Enable LZMA compression support in LLDB" LibLZMA LIBLZMA_FOUND)
@@ -75,7 +85,6 @@ option(LLDB_SKIP_DSYM "Whether to skip generating a dSYM when installing lldb."
7585

7686
# BEGIN SWIFT MOD
7787
option(LLDB_ENABLE_SWIFT_SUPPORT "Enable swift support" ON)
78-
option(LLDB_USE_STATIC_BINDINGS "Use the static Python bindings." OFF)
7988
option(LLDB_ENABLE_WERROR "Fail and stop if a warning is triggered." ${LLVM_ENABLE_WERROR})
8089
if(LLDB_ENABLE_SWIFT_SUPPORT)
8190
add_definitions( -DLLDB_ENABLE_SWIFT )

0 commit comments

Comments
 (0)