summaryrefslogtreecommitdiffstats
path: root/Tests/ObjectLibrary/Transitive/CMakeLists.txt
blob: 17247eb9cd592dfe1fb271bd550214d96ad5ca8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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)