Tests: Extend ObjectLibrary test with case for object lib dependencies

Add the test case from commit bab24e782c (target_link_libraries:
Propagate dependencies of object libraries, 2018-12-10,
v3.14.0-rc1~260^2) to the main ObjectLibrary test.
This commit is contained in:
Brad King 2020-03-04 12:58:29 -05:00
parent 07a7bc0e3f
commit 3b3de0fd17
5 changed files with 24 additions and 0 deletions

View File

@ -73,3 +73,5 @@ add_executable(UseABstaticObjs $<TARGET_OBJECTS:UseABstatic>)
target_link_libraries(UseABstaticObjs ABstatic)
add_subdirectory(ExportLanguages)
add_subdirectory(Transitive)

View File

@ -0,0 +1,7 @@
cmake_policy(SET CMP0022 NEW)
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)

View File

@ -0,0 +1,4 @@
int FooObject(void)
{
return 0;
}

View File

@ -0,0 +1,4 @@
int FooStatic(void)
{
return 0;
}

View File

@ -0,0 +1,7 @@
extern int FooObject(void);
extern int FooStatic(void);
int main(void)
{
return FooObject() + FooStatic();
}