From 328011f77a1cef00655a697cd2e503a97754b745 Mon Sep 17 00:00:00 2001 From: Andrew McNulty Date: Wed, 8 May 2024 19:05:47 +0200 Subject: [PATCH] Python: link correct limited API lib on mingw This commit fixes GH issue #13167 by linking to the correct library under MINGW when the 'limited_api' kwarg is specified. --- mesonbuild/dependencies/python.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mesonbuild/dependencies/python.py b/mesonbuild/dependencies/python.py index 56dddd932a29..a74423cb7194 100644 --- a/mesonbuild/dependencies/python.py +++ b/mesonbuild/dependencies/python.py @@ -248,9 +248,15 @@ def get_windows_link_args(self, limited_api: bool) -> T.Optional[T.List[str]]: lib = Path(self.variables.get('base_prefix')) / libpath elif self.platform.startswith('mingw'): if self.static: - libname = self.variables.get('LIBRARY') + if limited_api: + libname = self.variables.get('ABI3DLLLIBRARY') + else: + libname = self.variables.get('LIBRARY') else: - libname = self.variables.get('LDLIBRARY') + if limited_api: + libname = self.variables.get('ABI3LDLIBRARY') + else: + libname = self.variables.get('LDLIBRARY') lib = Path(self.variables.get('LIBDIR')) / libname else: raise mesonlib.MesonBugException(