From 10f3e6117b1154ca8e7e744809d82988f0ff481d Mon Sep 17 00:00:00 2001 From: Derek Mauro Date: Tue, 16 Jan 2024 08:53:54 -0800 Subject: [PATCH] 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 --- CMake/AbseilHelpers.cmake | 2 +- absl/log/CMakeLists.txt | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMake/AbseilHelpers.cmake b/CMake/AbseilHelpers.cmake index 18fb75ffd7f..bd1c71b073e 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 3c61fe8786a..a7d8b69031f 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 $ instead of +# the plain absl::log_flags. +# TODO(b/320467376): Implement the equivalent of Bazel's alwayslink=True. absl_cc_library( NAME log_flags