Skip to content

Commit

Permalink
Add Windows libs test to current_py_cc_libs tests
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nicholasjng committed Mar 28, 2024
1 parent 7da5951 commit 52f7b8d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/cc/current_py_cc_libs/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,19 @@ cc_test(
"@rules_python//python/cc:current_py_cc_libs",
],
)

# This is technically a headers test, but since the pyconfig.h header
# designates the appropriate lib to link on Win+MSVC, this test verifies that
# the expected Windows libraries are all present in the expected location.
# Since we define the Py_LIMITED_API macro, we expect the linker to go search
# for libs/python3.lib.
# buildifier: disable=native-cc
cc_test(
name = "python_libs_linking_windows_test",
srcs = ["python_libs_linking_test.cc"],
defines = ["Py_LIMITED_API=0x030A0000"],
target_compatible_with = ["@platforms//os:windows"],
deps = [
"@rules_python//python/cc:current_py_cc_headers",
],
)

0 comments on commit 52f7b8d

Please sign in to comment.