File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed
source/Plugins/ScriptInterpreter/Python Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ add_optional_dependency(LLDB_ENABLE_FBSDVMCORE "Enable libfbsdvmcore support in
68
68
option (LLDB_USE_ENTITLEMENTS "When codesigning, use entitlements if available" ON )
69
69
option (LLDB_BUILD_FRAMEWORK "Build LLDB.framework (Darwin only)" OFF )
70
70
option (LLDB_ENABLE_PROTOCOL_SERVERS "Enable protocol servers (e.g. MCP) in LLDB" ON )
71
+ option (LLDB_ENABLE_PYTHON_LIMITED_API "Force LLDB to only use the Python Limited API (requires SWIG 4.2 or later)" OFF )
71
72
option (LLDB_NO_INSTALL_DEFAULT_RPATH "Disable default RPATH settings in binaries" OFF )
72
73
option (LLDB_USE_SYSTEM_DEBUGSERVER "Use the system's debugserver for testing (Darwin only)." OFF )
73
74
option (LLDB_SKIP_STRIP "Whether to skip stripping of binaries when installing lldb." OFF )
Original file line number Diff line number Diff line change 45
45
46
46
#cmakedefine01 LLDB_ENABLE_PYTHON
47
47
48
+ #cmakedefine01 LLDB_ENABLE_PYTHON_LIMITED_API
49
+
48
50
#cmakedefine01 LLDB_ENABLE_FBSDVMCORE
49
51
50
52
#cmakedefine01 LLDB_EMBED_PYTHON_HOME
Original file line number Diff line number Diff line change @@ -45,12 +45,20 @@ static llvm::Expected<bool> *g_fcxx_modules_workaround [[maybe_unused]];
45
45
#include < locale>
46
46
#endif
47
47
48
+ #define LLDB_MINIMUM_PYTHON_VERSION 0x03080000
49
+
50
+ #if LLDB_ENABLE_PYTHON_LIMITED_API
51
+ // If defined, LLDB will be ABI-compatible with all Python 3 releases from the
52
+ // specified one onward, and can use Limited API introduced up to that version.
53
+ #define Py_LIMITED_API LLDB_MINIMUM_PYTHON_VERSION
54
+ #endif
55
+
48
56
// Include python for non windows machines
49
57
#include < Python.h>
50
58
51
59
// Provide a meaningful diagnostic error if someone tries to compile this file
52
60
// with a version of Python we don't support.
53
- static_assert (PY_VERSION_HEX >= 0x03080000 ,
61
+ static_assert (PY_VERSION_HEX >= LLDB_MINIMUM_PYTHON_VERSION ,
54
62
" LLDB requires at least Python 3.8" );
55
63
#endif
56
64
You can’t perform that action at this time.
0 commit comments