Skip to content

Commit

Permalink
Avoid linkstatic on macOS, see bazelbuild/bazel#11552.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 314961517
  • Loading branch information
bjacob authored and copybara-github committed Jun 5, 2020
1 parent a37cc4d commit b3292a6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
25 changes: 21 additions & 4 deletions third_party/clog.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,27 @@ cc_library(
srcs = [
"deps/clog/src/clog.c",
],
hdrs = [
"deps/clog/include/clog.h",
],
copts = select({
":windows": [],
"//conditions:default": ["-Wno-unused-result"],
}),
hdrs = [
"deps/clog/include/clog.h",
],
linkopts = select({
":android": ["-llog"],
"//conditions:default": [],
}),
linkstatic = True,
linkstatic = select({
# https://github.com/bazelbuild/bazel/issues/11552
":macos_x86_64": False,
"//conditions:default": True,
}),
defines = select({
# When linkstatic=False, we need default visibility
":macos_x86_64": ["CLOG_VISIBILITY="],
"//conditions:default": True,
}),
strip_include_prefix = "deps/clog/include",
)

Expand All @@ -36,3 +45,11 @@ config_setting(
name = "windows",
values = {"cpu": "x64_windows"},
)

config_setting(
name = "macos_x86_64",
values = {
"apple_platform_type": "macos",
"cpu": "darwin",
},
)
6 changes: 5 additions & 1 deletion third_party/cpuinfo.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,11 @@ cc_library(
"-Iexternal/cpuinfo/include",
"-Iexternal/cpuinfo/src",
],
linkstatic = True,
linkstatic = select({
# https://github.com/bazelbuild/bazel/issues/11552
":macos_x86_64": False,
"//conditions:default": True,
}),
# Headers must be in textual_hdrs to allow us to set the standard to C99
textual_hdrs = [
"include/cpuinfo.h",
Expand Down

0 comments on commit b3292a6

Please sign in to comment.