Create a LINK_WHAT_YOU_USE target property and corresponding CMAKE_LINK_WHAT_YOU_USE variable to enable this behavior. Extend link commands by running `ldd -u -r` to detect shared libraries that are linked but not needed.
5 lines
115 B
CMake
5 lines
115 B
CMake
enable_language(CXX)
|
|
set(CMAKE_LINK_WHAT_YOU_USE TRUE)
|
|
add_executable(main main.cxx)
|
|
target_link_libraries(main m)
|