-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gh-82909: Update PC/pyconfig.h to allow disabling pragma based auto-linking #19740
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
Changes from all commits
56da8f9
7aa18a2
29268cc
3658f4c
23c9af6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
``#pragma``-based linking with ``python3*.lib`` can now be switched off with | ||
:c:expr:`Py_NO_LINK_LIB`. Patch by Jean-Christophe Fillion-Robin. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -311,9 +311,13 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */ | |
#ifdef MS_COREDLL | ||
# if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN) | ||
/* not building the core - must be an ext */ | ||
# if defined(_MSC_VER) | ||
# if defined(_MSC_VER) && !defined(Py_NO_LINK_LIB) | ||
Comment on lines
311
to
+314
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This whole set of conditions is pretty ugly... any interest in simplifying? Ideally in this order:
The order doesn't need to be spelled out to anyone reading it, but it should make it easiest to read (the first check has the best name) and easiest to maintain (alternate compilers can be supported in the "middle", not the edges). It also really doesn't need to be indented by 8 characters. Four would be plenty. |
||
/* So MSVC users need not specify the .lib | ||
file in their Makefile */ | ||
/* Define Py_NO_LINK_LIB to build extension disabling pragma | ||
based auto-linking. | ||
This is relevant when using build-system generator (e.g CMake) where | ||
the linking is explicitly handled */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment isn't important for this file, though a short header above the entire block (something like "automatically reference python3x.lib") might make it easier to understand the purpose without reading the whole way through. |
||
# if defined(Py_GIL_DISABLED) | ||
# if defined(_DEBUG) | ||
# pragma comment(lib,"python314t_d.lib") | ||
|
@@ -331,7 +335,7 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */ | |
# pragma comment(lib,"python314.lib") | ||
# endif /* _DEBUG */ | ||
# endif /* Py_GIL_DISABLED */ | ||
# endif /* _MSC_VER */ | ||
# endif /* _MSC_VER && !Py_NO_LINK_LIB */ | ||
# endif /* Py_BUILD_CORE */ | ||
#endif /* MS_COREDLL */ | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See also #134830