@@ -5,20 +5,6 @@ package(default_visibility = ["//visibility:public"])
55
66licenses(["notice"]) # Apache 2.0
77
8- # Ensure that ws2_32.lib is linked for mingw.
9- # copybara:strip_begin
10- _WS2_32_LINKOPTS = []
11- # copybara:strip_end_and_replace_begin
12- # _WS2_32_LINKOPTS = select({
13- # "@tensorstore//:compiler_mingw_gcc": [
14- # "-DEFAULTLIB:ws2_32.lib",
15- # "-lws2_32",
16- # ],
17- # "@tensorstore//:compiler_msvc": ["-DEFAULTLIB:ws2_32.lib"],
18- # "//conditions:default": [],
19- # })
20- # copybara:replace_end
21-
228cc_library(
239 name = "aws_c_io",
2410 srcs = glob([
@@ -34,6 +20,7 @@ cc_library(
3420 "@platforms//os:osx": glob([
3521 "source/bsd/*.c",
3622 "source/darwin/*.c",
23+ "source/darwin/*.h",
3724 "source/posix/*.c",
3825 ]),
3926 "//conditions:default": glob([
@@ -48,26 +35,26 @@ cc_library(
4835 ]),
4936 includes = ["include"],
5037 linkopts = select({
51- "@platforms//os:windows ": [
38+ ":compiler_msvc ": [
5239 "-DEFAULTLIB:ncrypt.lib",
5340 "-DEFAULTLIB:ws2_32.lib",
5441 "-DEFAULTLIB:secur32.lib",
5542 "-DEFAULTLIB:crypt32.lib",
5643 "-DEFAULTLIB:kernel32.lib",
5744 ],
58- "//conditions:default": [
59- "-ldl",
60- "-lpthread",
61- ],
62- }) + select({
6345 ":compiler_mingw_gcc": [
6446 "-lncrypt",
6547 "-lws2_32",
6648 "-lsecur32",
6749 "-lcrypt32",
6850 "-lkernel32",
51+ "-ldl",
52+ "-lpthread",
53+ ],
54+ "//conditions:default": [
55+ "-ldl",
56+ "-lpthread",
6957 ],
70- "//conditions:default": [],
7158 }),
7259 local_defines = ["AWS_S2N_INSOURCE_PATH"] + select({
7360 "@platforms//os:windows": [
@@ -94,12 +81,16 @@ cc_library(
9481 }),
9582)
9683
97- [
98- alias(
99- name = name,
100- actual = "@tensorstore//:{target}".format(target = name),
101- )
102- for name in [
103- "compiler_mingw_gcc",
104- ]
105- ]
84+ config_setting(
85+ name = "compiler_mingw_gcc",
86+ flag_values = {
87+ "@bazel_tools//tools/cpp:compiler": "mingw-gcc",
88+ },
89+ )
90+
91+ config_setting(
92+ name = "compiler_msvc",
93+ flag_values = {
94+ "@bazel_tools//tools/cpp:compiler": "msvc-cl",
95+ },
96+ )
0 commit comments