diff options
author | Andrew McNulty <amcn102@gmail.com> | 2023-04-24 09:52:28 +0200 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2023-08-14 20:02:09 -0400 |
commit | c7308076966c1c55bc117ce9f7a7f49ac96acfa6 (patch) | |
tree | 826fcf546090c3a5155c1d730d34033563038d98 /run_project_tests.py | |
parent | 9d323020321893093492bc7d538c311c61398a1e (diff) | |
download | meson-c7308076966c1c55bc117ce9f7a7f49ac96acfa6.zip meson-c7308076966c1c55bc117ce9f7a7f49ac96acfa6.tar.gz meson-c7308076966c1c55bc117ce9f7a7f49ac96acfa6.tar.bz2 |
Python: Add 'limited_api' kwarg to extension_module
This commit adds a new keyword arg to extension_module() that enables
a user to target the Python Limited API, declaring the version of the
limited API that they wish to target.
Two new unittests have been added to test this functionality.
Diffstat (limited to 'run_project_tests.py')
-rwxr-xr-x | run_project_tests.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/run_project_tests.py b/run_project_tests.py index facf1e9..27020ca 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -148,7 +148,7 @@ class InstalledFile: canonical_compiler = 'msvc' python_suffix = python.info['suffix'] - + python_limited_suffix = python.info['limited_api_suffix'] has_pdb = False if self.language in {'c', 'cpp'}: has_pdb = canonical_compiler == 'msvc' @@ -167,7 +167,7 @@ class InstalledFile: return None # Handle the different types - if self.typ in {'py_implib', 'python_lib', 'python_file'}: + if self.typ in {'py_implib', 'py_limited_implib', 'python_lib', 'python_limited_lib', 'python_file'}: val = p.as_posix() val = val.replace('@PYTHON_PLATLIB@', python.platlib) val = val.replace('@PYTHON_PURELIB@', python.purelib) @@ -176,6 +176,8 @@ class InstalledFile: return p if self.typ == 'python_lib': return p.with_suffix(python_suffix) + if self.typ == 'python_limited_lib': + return p.with_suffix(python_limited_suffix) if self.typ == 'py_implib': p = p.with_suffix(python_suffix) if env.machines.host.is_windows() and canonical_compiler == 'msvc': @@ -184,6 +186,14 @@ class InstalledFile: return p.with_suffix('.dll.a') else: return None + if self.typ == 'py_limited_implib': + p = p.with_suffix(python_limited_suffix) + if env.machines.host.is_windows() and canonical_compiler == 'msvc': + return p.with_suffix('.lib') + elif env.machines.host.is_windows() or env.machines.host.is_cygwin(): + return p.with_suffix('.dll.a') + else: + return None elif self.typ in {'file', 'dir'}: return p elif self.typ == 'shared_lib': |