Skip to content

Commit a1e6010

Browse files
authored
examples: enable cares on windows (#1520)
c-ares builds fine on Windows with the existing cmake rule, it just needed CARES_STATICLIB defined when consuming the static library so the headers use the right calling convention.
1 parent 4b7740e commit a1e6010

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

examples/third_party/cares/BUILD.bazel

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,21 @@ cc_test(
66
name = "test",
77
size = "small",
88
srcs = ["c-ares-test.cpp"],
9+
local_defines = select({
10+
"@platforms//os:windows": ["CARES_STATICLIB"],
11+
"//conditions:default": [],
12+
}),
913
visibility = ["//:__pkg__"],
1014
deps = ["@cares"],
1115
)
1216

1317
cc_library(
1418
name = "lib",
1519
srcs = ["c-ares-test.cpp"],
20+
local_defines = select({
21+
"@platforms//os:windows": ["CARES_STATICLIB"],
22+
"//conditions:default": [],
23+
}),
1624
deps = ["@cares"],
1725
)
1826

examples/third_party/cares/BUILD.cares.bazel

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,4 @@ cmake(
2323
"@platforms//os:windows": ["cares.lib"],
2424
"//conditions:default": ["libcares.a"],
2525
}),
26-
target_compatible_with = select({
27-
"@platforms//os:windows": ["@rules_foreign_cc_examples_third_party//:broken"],
28-
"//conditions:default": [],
29-
}),
3026
)

0 commit comments

Comments
 (0)