Skip to content

Commit 6ffa848

Browse files
authored
Fix issue 892 (#893)
1 parent 0563059 commit 6ffa848

File tree

5 files changed

+23
-15
lines changed

5 files changed

+23
-15
lines changed

bazel/curl.BUILD

+23-4
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@ package(features = ["no_copts_tokenization"])
66

77
config_setting(
88
name = "windows",
9-
values = {"cpu": "x64_windows"},
9+
constraint_values = [
10+
"@bazel_tools//platforms:windows",
11+
],
1012
visibility = ["//visibility:private"],
1113
)
1214

1315
config_setting(
1416
name = "osx",
15-
values = {"cpu": "darwin"},
17+
constraint_values = [
18+
"@bazel_tools//platforms:osx",
19+
],
1620
visibility = ["//visibility:private"],
1721
)
1822

@@ -27,11 +31,26 @@ cc_library(
2731
]),
2832
copts = CURL_COPTS + [
2933
"-DOS=\"os\"",
30-
"-DCURL_EXTERN_SYMBOL=__attribute__((__visibility__(\"default\")))",
3134
],
35+
defines = ["CURL_STATICLIB"],
3236
includes = [
3337
"include/",
3438
"lib/",
3539
],
40+
linkopts = select({
41+
"//:windows": [
42+
"-DEFAULTLIB:ws2_32.lib",
43+
"-DEFAULTLIB:advapi32.lib",
44+
"-DEFAULTLIB:crypt32.lib",
45+
"-DEFAULTLIB:Normaliz.lib",
46+
],
47+
"//:osx": [
48+
"-framework SystemConfiguration",
49+
"-lpthread",
50+
],
51+
"//conditions:default": [
52+
"-lpthread",
53+
],
54+
}),
3655
visibility = ["//visibility:public"],
37-
)
56+
)

examples/http/BUILD

-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ cc_binary(
44
"client.cc",
55
"tracer_common.h",
66
],
7-
# TODO: Move copts/linkopts for static CURL usage into shared bzl file.
87
copts = [
9-
"-DCURL_STATICLIB",
108
"-DWITH_CURL",
119
],
1210
linkopts = select({

exporters/elasticsearch/BUILD

-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ cc_library(
99
"include/opentelemetry/exporters/elasticsearch/es_log_exporter.h",
1010
"include/opentelemetry/exporters/elasticsearch/es_log_recordable.h",
1111
],
12-
copts = [
13-
"-DCURL_STATICLIB",
14-
],
1512
linkopts = select({
1613
"//bazel:windows": [
1714
"-DEFAULTLIB:advapi32.lib",

ext/src/http/client/curl/BUILD

-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ cc_library(
66
"http_client_curl.cc",
77
"http_client_factory_curl.cc",
88
],
9-
# TODO: Move copts/linkopts for static CURL usage into shared bzl file.
109
copts = [
11-
"-DCURL_STATICLIB",
1210
"-DWITH_CURL",
1311
],
1412
include_prefix = "src/http/client/curl",

ext/test/w3c_tracecontext_test/BUILD

-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ cc_binary(
33
srcs = [
44
"main.cc",
55
],
6-
# TODO: Move copts/linkopts for static CURL usage into shared bzl file.
7-
copts = [
8-
"-DCURL_STATICLIB",
9-
],
106
linkopts = select({
117
"//bazel:windows": [
128
"-DEFAULTLIB:advapi32.lib",

0 commit comments

Comments
 (0)