[cmake-developers] ninja parallelism and LLVM cmake builds
Stephen Kelly
steveire at gmail.com
Tue Feb 11 08:46:30 EST 2014
Brad King wrote:
> target_link_libraries(staticB INTERFACE staticA)
>
> However, that will propagate all usage requirements of A to consumers
> of B. Depending on the usage requirements specified for A and B that
> may be correct or not.
We could consider making the LINK_ONLY generator expression public in order
to allow the user to decide the granularity here (possibly encapsulated in a
INTERFACE_LIBRARY).
add_library(ifaceA INTERFACE)
target_link_libraries(ifaceA INTERFACE $<LINK_ONLY:staticA>)
target_include_directories(ifaceA
INTERFACE $<TARGET_PROPERTY:staticA,INTERFACE_INCLUDE_DIRECTORIES>)
# Propagate the includes from A, but not the compile definitions
# or compile options.
target_link_libraries(staticB ifaceA)
Thanks,
Steve.
More information about the cmake-developers
mailing list