Skip to content

Commit 285e553

Browse files
committed
bpo-38728: Update PC/pyconfig.h to allow disabling pragma based auto-linking
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
1 parent b94dbd7 commit 285e553

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

PC/pyconfig.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,14 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
264264
#ifdef MS_COREDLL
265265
# if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN)
266266
/* not building the core - must be an ext */
267-
# if defined(_MSC_VER)
267+
# if defined(_MSC_VER) && !defined(PY_NO_LINK_LIB)
268268
/* So MSVC users need not specify the .lib
269269
file in their Makefile (other compilers are
270270
generally taken care of by distutils.) */
271+
/* Define PY_NO_LINK_LIB to build extension disabling pragma
272+
based auto-linking.
273+
This is relevant when using build-system generator (e.g CMake) where
274+
the linking is explicitly handled */
271275
# if defined(_DEBUG)
272276
# pragma comment(lib,"python39_d.lib")
273277
# elif defined(Py_LIMITED_API)

0 commit comments

Comments
 (0)