Skip to content

Commit 05a6b9c

Browse files
committed
tests/simple_binary: add a foo.pyd windows only target
1 parent 16a322f commit 05a6b9c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/simple_binary/BUILD

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,17 @@ cc_binary(
2727
linkshared = 1,
2828
)
2929

30+
# On windows, python use .pyd extension for native modules.
31+
cc_binary(
32+
name = "foo.pyd",
33+
srcs = ["foo.cc"],
34+
linkshared = 1,
35+
target_compatible_with = select({
36+
"@platforms//os:windows": [],
37+
"//conditions:default": ["@platforms//:incompatible"],
38+
}),
39+
)
40+
3041
# Regression test for building C code
3142
# https://github.com/bazelbuild/rules_cc/pull/440#issuecomment-3075519628
3243
cc_binary(

0 commit comments

Comments
 (0)