Why not transitively link to OBJECT libraries
From the target_link_libraries document,
add_library(A OBJECT a.c)
add_library(B OBJECT b.c)
target_link_libraries(B PUBLIC A)
add_executable(C main.c)
target_link_libraries(C PUBLIC B)
creates executable C
from main.c
and b.c
but not a.c
. But library dependencies are transitive, B -> A
and C -> A
should imply C -> A
(->
means"link to"), i.e. imply a call to target_link_libraries(C PUBLIC A)
, right?