Add `-llog` to linker options when building log_sink_set in logging internals.

In Android builds this library calls __android_log_write directly, and so needs this linker dep.

PiperOrigin-RevId: 474080654
Change-Id: I19f6ac4f78e635541ccad08ec9e553adfe609b3f
pull/1277/head
Greg Falcon 3 years ago committed by Copybara-Service
parent b92f23a08a
commit 530cd52f58
  1. 1
      absl/log/CMakeLists.txt
  2. 5
      absl/log/internal/BUILD.bazel

@ -173,6 +173,7 @@ absl_cc_library(
${ABSL_DEFAULT_COPTS}
LINKOPTS
${ABSL_DEFAULT_LINKOPTS}
$<$<BOOL:${ANDROID}>:-llog>
DEPS
absl::base
absl::cleanup

@ -163,7 +163,10 @@ cc_library(
srcs = ["log_sink_set.cc"],
hdrs = ["log_sink_set.h"],
copts = ABSL_DEFAULT_COPTS,
linkopts = ABSL_DEFAULT_LINKOPTS,
linkopts = ABSL_DEFAULT_LINKOPTS + select({
"//conditions:default": [],
"@platforms//os:android": ["-llog"],
}),
deps = [
":config",
":globals",

Loading…
Cancel
Save