summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Derek Mauro <dmauro@google.com>2024-01-16 08:53:54 -0800
committerGravatar Copybara-Service <copybara-worker@google.com>2024-01-16 08:54:41 -0800
commit10f3e6117b1154ca8e7e744809d82988f0ff481d (patch)
treea895998b3c772bdbf6013c8e333a35ce5ee5df36
parentb2dd3a5be797f8194bbc230c65f35aadd3998535 (diff)
Add a note about how to link absl::log_flags under CMake to workaround
the lack of a feature equivalent to Bazel's alwayslink=True PiperOrigin-RevId: 598855446 Change-Id: I0bb3bc40005908106eb7a7252572e3af153a7f5c
-rw-r--r--CMake/AbseilHelpers.cmake2
-rw-r--r--absl/log/CMakeLists.txt5
2 files changed, 6 insertions, 1 deletions
diff --git a/CMake/AbseilHelpers.cmake b/CMake/AbseilHelpers.cmake
index 18fb75ff..bd1c71b0 100644
--- a/CMake/AbseilHelpers.cmake
+++ b/CMake/AbseilHelpers.cmake
@@ -80,7 +80,7 @@ endif()
# absl::fantastic_lib
# )
#
-# TODO: Implement "ALWAYSLINK"
+# TODO(b/320467376): Implement "ALWAYSLINK".
function(absl_cc_library)
cmake_parse_arguments(ABSL_CC_LIB
"DISABLE_INSTALL;PUBLIC;TESTONLY"
diff --git a/absl/log/CMakeLists.txt b/absl/log/CMakeLists.txt
index 3c61fe87..a7d8b690 100644
--- a/absl/log/CMakeLists.txt
+++ b/absl/log/CMakeLists.txt
@@ -461,6 +461,11 @@ absl_cc_library(
PUBLIC
)
+# Warning: Many linkers will strip the contents of this library because its
+# symbols are only used in a global constructor. A workaround is for clients
+# to link this using $<LINK_LIBRARY:WHOLE_ARCHIVE,absl::log_flags> instead of
+# the plain absl::log_flags.
+# TODO(b/320467376): Implement the equivalent of Bazel's alwayslink=True.
absl_cc_library(
NAME
log_flags