gh-112984: Fix link error on free-threaded Windows build (GH-114455)

The test_peg_generator test tried to link the python313_d.lib library,
which failed because the library is now named python313t_d.lib. The
underlying problem is that the "compiler" attribute was not set when
we call get_libraries() from distutils.
This commit is contained in:
Sam Gross 2024-01-23 13:05:15 -05:00 committed by GitHub
parent ba253a4794
commit 5f1997896d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -220,6 +220,9 @@ def compile_c_extension(
)
else:
objects = compiler.object_filenames(extension.sources, output_dir=cmd.build_temp)
# The cmd.get_libraries() call needs a valid compiler attribute or we will
# get an incorrect library name on the free-threaded Windows build.
cmd.compiler = compiler
# Now link the object files together into a "shared object"
compiler.link_shared_object(
objects,