Skip to content

Commit

Permalink
Fix issue 892
Browse files Browse the repository at this point in the history
Signed-off-by: owent <admin@owent.net>
  • Loading branch information
owent committed Jul 7, 2021
1 parent 0563059 commit c73d029
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 12 deletions.
28 changes: 24 additions & 4 deletions bazel/curl.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ package(features = ["no_copts_tokenization"])

config_setting(
name = "windows",
values = {"cpu": "x64_windows"},
constraint_values = [
"@bazel_tools//platforms:windows",
],
visibility = ["//visibility:private"],
)

config_setting(
name = "osx",
values = {"cpu": "darwin"},
constraint_values = [
"@bazel_tools//platforms:osx",
],
visibility = ["//visibility:private"],
)

Expand All @@ -27,11 +31,27 @@ cc_library(
]),
copts = CURL_COPTS + [
"-DOS=\"os\"",
"-DCURL_EXTERN_SYMBOL=__attribute__((__visibility__(\"default\")))",
# "-DCURL_EXTERN_SYMBOL=__attribute__((__visibility__(\"default\")))",
],
defines = ["CURL_STATICLIB"],
includes = [
"include/",
"lib/",
],
linkopts = select({
"//:windows": [
"-DEFAULTLIB:ws2_32.lib",
"-DEFAULTLIB:advapi32.lib",
"-DEFAULTLIB:crypt32.lib",
"-DEFAULTLIB:Normaliz.lib",
],
"//:osx": [
"-framework SystemConfiguration",
"-lpthread",
],
"//conditions:default": [
"-lpthread",
],
}),
visibility = ["//visibility:public"],
)
)
2 changes: 1 addition & 1 deletion examples/http/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cc_binary(
],
# TODO: Move copts/linkopts for static CURL usage into shared bzl file.
copts = [
"-DCURL_STATICLIB",
# "-DCURL_STATICLIB",
"-DWITH_CURL",
],
linkopts = select({
Expand Down
6 changes: 3 additions & 3 deletions exporters/elasticsearch/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ cc_library(
"include/opentelemetry/exporters/elasticsearch/es_log_exporter.h",
"include/opentelemetry/exporters/elasticsearch/es_log_recordable.h",
],
copts = [
"-DCURL_STATICLIB",
],
# copts = [
# "-DCURL_STATICLIB",
# ],
linkopts = select({
"//bazel:windows": [
"-DEFAULTLIB:advapi32.lib",
Expand Down
2 changes: 1 addition & 1 deletion ext/src/http/client/curl/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ cc_library(
],
# TODO: Move copts/linkopts for static CURL usage into shared bzl file.
copts = [
"-DCURL_STATICLIB",
# "-DCURL_STATICLIB",
"-DWITH_CURL",
],
include_prefix = "src/http/client/curl",
Expand Down
6 changes: 3 additions & 3 deletions ext/test/w3c_tracecontext_test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ cc_binary(
"main.cc",
],
# TODO: Move copts/linkopts for static CURL usage into shared bzl file.
copts = [
"-DCURL_STATICLIB",
],
# copts = [
# "-DCURL_STATICLIB",
# ],
linkopts = select({
"//bazel:windows": [
"-DEFAULTLIB:advapi32.lib",
Expand Down

0 comments on commit c73d029

Please sign in to comment.