Skip to content

Commit

Permalink
test: Fix unresolved symbol test on Windows
Browse files Browse the repository at this point in the history
Signed-off-by: Michał Górny <mgorny@gentoo.org>
  • Loading branch information
mgorny committed Jul 16, 2024
1 parent 9c131a0 commit 26abeb0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/test_c_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,22 @@ def inner(code=""):
}}
""")
pytester.makepyfile(setup=f"""
import os
from setuptools import setup, Extension
extra_link_args = []
# TODO: this should really be per-linker
if os.name == "nt":
extra_link_args.append("/force:unresolved")
setup(name="test",
version="0",
ext_modules=[
Extension(name="test",
sources=["test.c"],
py_limited_api={py_limited_api}),
py_limited_api={py_limited_api},
extra_link_args=extra_link_args),
])
""")
subprocess.run([sys.executable, "setup.py", "build_ext", "-i"],
Expand Down

0 comments on commit 26abeb0

Please sign in to comment.