mirror of
https://github.com/python/cpython.git
synced 2025-08-15 14:20:55 +00:00
[3.12] gh-127906: Test the limited C API in test_cppext (GH-127916) (#127920)
gh-127906: Test the limited C API in test_cppext (GH-127916)
(cherry picked from commit d05a4e6a0d
)
Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
5a658d85d5
commit
58916eb211
4 changed files with 25 additions and 3 deletions
|
@ -33,6 +33,7 @@ def main():
|
|||
cppflags = list(CPPFLAGS)
|
||||
std = os.environ.get("CPYTHON_TEST_CPP_STD", "")
|
||||
module_name = os.environ["CPYTHON_TEST_EXT_NAME"]
|
||||
limited = bool(os.environ.get("CPYTHON_TEST_LIMITED", ""))
|
||||
|
||||
cppflags = list(CPPFLAGS)
|
||||
cppflags.append(f'-DMODULE_NAME={module_name}')
|
||||
|
@ -59,6 +60,11 @@ def main():
|
|||
# CC env var overrides sysconfig CC variable in setuptools
|
||||
os.environ['CC'] = cmd
|
||||
|
||||
# Define Py_LIMITED_API macro
|
||||
if limited:
|
||||
version = sys.hexversion
|
||||
cppflags.append(f'-DPy_LIMITED_API={version:#x}')
|
||||
|
||||
# On Windows, add PCbuild\amd64\ to include and library directories
|
||||
include_dirs = []
|
||||
library_dirs = []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue