MODULE library is missing the lwyu flags and step when using INCLUDE_WHAT_YOU_USE
When building the MODULE library with CMAKE_LINK_WHAT_YOU_USE
enabled, the lwyu flag (-Wl,--no-as-needed
) and the ldd step, that gives a warning about unused direct dependencies, are missing.
/* src.c */
int foo(void) {return 0;}
set(CMAKE_LINK_WHAT_YOU_USE TRUE)
add_library(module MODULE src.c)
add_library(shared SHARED src.c)
target_link_libraries(module m)
target_link_libraries(shared m)
When checking the CMakeFiles/module.dir/link.txt
and the CMakeFiles/shared.dir/link.txt
, there is a difference between the lwyu and the ldd step. I think the MODULE libraries could also get the warning.