Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 52f7b8d

Browse files
committed
Add Windows libs test to current_py_cc_libs tests
Reuses the existing cc_test targeting the stable ABI on Windows. Since this prompts MSVC to search for libs/python3.lib, it serves as a check that the library search path is intact on Windows.
1 parent 7da5951 commit 52f7b8d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/cc/current_py_cc_libs/BUILD.bazel

+16
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,19 @@ cc_test(
3131
"@rules_python//python/cc:current_py_cc_libs",
3232
],
3333
)
34+
35+
# This is technically a headers test, but since the pyconfig.h header
36+
# designates the appropriate lib to link on Win+MSVC, this test verifies that
37+
# the expected Windows libraries are all present in the expected location.
38+
# Since we define the Py_LIMITED_API macro, we expect the linker to go search
39+
# for libs/python3.lib.
40+
# buildifier: disable=native-cc
41+
cc_test(
42+
name = "python_libs_linking_windows_test",
43+
srcs = ["python_libs_linking_test.cc"],
44+
defines = ["Py_LIMITED_API=0x030A0000"],
45+
target_compatible_with = ["@platforms//os:windows"],
46+
deps = [
47+
"@rules_python//python/cc:current_py_cc_headers",
48+
],
49+
)

0 commit comments

Comments
 (0)