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
6868option (LLDB_USE_ENTITLEMENTS "When codesigning, use entitlements if available" ON )
6969option (LLDB_BUILD_FRAMEWORK "Build LLDB.framework (Darwin only)" OFF )
7070option (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 )
7172option (LLDB_NO_INSTALL_DEFAULT_RPATH "Disable default RPATH settings in binaries" OFF )
7273option (LLDB_USE_SYSTEM_DEBUGSERVER "Use the system's debugserver for testing (Darwin only)." OFF )
7374option (LLDB_SKIP_STRIP "Whether to skip stripping of binaries when installing lldb." OFF )
Original file line number Diff line number Diff line change 4545
4646#cmakedefine01 LLDB_ENABLE_PYTHON
4747
48+ #cmakedefine01 LLDB_ENABLE_PYTHON_LIMITED_API
49+
4850#cmakedefine01 LLDB_ENABLE_FBSDVMCORE
4951
5052#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]];
4545#include < locale>
4646#endif
4747
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+
4856// Include python for non windows machines
4957#include < Python.h>
5058
5159// Provide a meaningful diagnostic error if someone tries to compile this file
5260// 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 ,
5462 " LLDB requires at least Python 3.8" );
5563#endif
5664
You can’t perform that action at this time.
0 commit comments