Skip to content

Commit 10f3e61

Browse files
derekmaurocopybara-github
authored andcommitted
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
1 parent b2dd3a5 commit 10f3e61

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CMake/AbseilHelpers.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ endif()
8080
# absl::fantastic_lib
8181
# )
8282
#
83-
# TODO: Implement "ALWAYSLINK"
83+
# TODO(b/320467376): Implement "ALWAYSLINK".
8484
function(absl_cc_library)
8585
cmake_parse_arguments(ABSL_CC_LIB
8686
"DISABLE_INSTALL;PUBLIC;TESTONLY"

absl/log/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,11 @@ absl_cc_library(
461461
PUBLIC
462462
)
463463

464+
# Warning: Many linkers will strip the contents of this library because its
465+
# symbols are only used in a global constructor. A workaround is for clients
466+
# to link this using $<LINK_LIBRARY:WHOLE_ARCHIVE,absl::log_flags> instead of
467+
# the plain absl::log_flags.
468+
# TODO(b/320467376): Implement the equivalent of Bazel's alwayslink=True.
464469
absl_cc_library(
465470
NAME
466471
log_flags

0 commit comments

Comments
 (0)