Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-85283: Fix _ctypes_test build on Windows in release mode #111005

Merged
merged 1 commit into from
Oct 17, 2023

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Oct 17, 2023

Define Py_BUILD_CORE to not attempt to link the extension to python3.lib (which fails).

@vstinner
Copy link
Member Author

Extract of PC/pyconfig.h:

#                       if defined(_DEBUG)
#                               pragma comment(lib,"python313_d.lib")
#                       elif defined(Py_LIMITED_API)
#                               pragma comment(lib,"python3.lib")
#                       else
#                               pragma comment(lib,"python313.lib")
#                       endif /* _DEBUG */

In debug mode, extensions are always linked to python313_d.lib. But in release mode, extensions are linked to python3.lib if Py_LIMITED_API is defined.

Define Py_BUILD_CORE to not attempt to link the extension to
python3.lib (which fails).
@vstinner vstinner merged commit 2ba6f68 into python:main Oct 17, 2023
@vstinner vstinner deleted the ctypes_test_core branch October 17, 2023 21:45
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
…thon#111005)

Define Py_BUILD_CORE to not attempt to link the extension to
python3.lib (which fails).
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
…thon#111005)

Define Py_BUILD_CORE to not attempt to link the extension to
python3.lib (which fails).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant