CMAKE_<LANG>_LINK_WHAT_YOU_USE_FLAG
Added in version 3.22.
Linker flag used by LINK_WHAT_YOU_USE to tell the linker to link all shared libraries specified on the command line even if none of their symbols is needed. This is an implementation detail used so that the command in CMAKE_LINK_WHAT_YOU_USE_CHECK can check the binary for unnecessarily-linked shared libraries.
Note
Do not rely on this abstraction to intentionally link to shared libraries whose symbols are not needed.
© 2000–2026 Kitware, Inc. and Contributors
Licensed under the BSD 3-clause License.
https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_LINK_WHAT_YOU_USE_FLAG.html