You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
1.1 KiB

add_library(FooStatic STATIC FooStatic.c)
add_library(FooObject1 OBJECT FooObject.c)
target_link_libraries(FooObject1 PRIVATE FooStatic)
add_executable(Transitive1 Transitive.c)
target_link_libraries(Transitive1 PRIVATE FooObject1)
add_library(FooObject2 OBJECT FooObject.c)
target_link_libraries(FooObject2 INTERFACE FooStatic)
add_executable(Transitive2 Transitive.c)
target_link_libraries(Transitive2 PRIVATE FooObject2)
add_library(FooObjectDirect OBJECT FooObject.c)
add_library(FooStaticDirect STATIC FooStatic.c)
set_property(TARGET FooStaticDirect PROPERTY INTERFACE_LINK_LIBRARIES_DIRECT FooObjectDirect)
add_executable(TransitiveDirect Transitive.c)
target_link_libraries(TransitiveDirect PRIVATE FooStaticDirect)
add_library(BarObject1 OBJECT BarObject1.c)
add_library(BarObject2 OBJECT BarObject2.c)
add_library(BarObject3 OBJECT BarObject3.c)
set_property(TARGET BarObject1 PROPERTY INTERFACE_LINK_LIBRARIES_DIRECT BarObject2)
set_property(TARGET BarObject2 PROPERTY INTERFACE_LINK_LIBRARIES_DIRECT BarObject3)
add_executable(BarMain BarMain.c)
target_link_libraries(BarMain PRIVATE BarObject1)