Files
llvm-tms34010/lldb/source/Plugins/ScriptInterpreter/Python
Charles Zablit 4bf77a4abb [lldb][windows] Fix Python library link for LLDB_ENABLE_PYTHON_LIMITED_API (#201407)
When `LLDB_ENABLE_PYTHON_LIMITED_API` is `ON`, `liblldb` should link
against `python3.dll` (stable ABI) rather than the `python310.dll`.

Previously, two issues prevented this on Windows:

1. The `ScriptInterpreter` plugin explicitly linked
`${Python3_LIBRARIES}` regardless of whether the limited API was
enabled.

2. Python's `pyconfig.h` emits a `#pragma` to select the import library
at link time, choosing `python3.lib` or `python310.lib` depending on
whether `Py_LIMITED_API` is defined. However,
`LLDB_ENABLE_PYTHON_LIMITED_API` was only surfaced through Config.h,
which is not included early enough in the compilation chain to affect
pyconfig.h in all translation units.

This patch fixes both issues.

This is needed for https://github.com/llvm/llvm-project/pull/200533.
2026-06-05 20:35:39 +01:00
..