diff options
author | Brad King <brad.king@kitware.com> | 2020-03-04 17:58:29 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-03-04 18:04:00 (GMT) |
commit | 3b3de0fd17d45f1927a28b4c52ba5146325b1bb0 (patch) | |
tree | 3fc85a5344abb0e0d6544e804ad11eb629464290 /Tests/ObjectLibrary/Transitive | |
parent | 07a7bc0e3fc370eaa5593cffcd07c0ea739cfc9c (diff) | |
download | CMake-3b3de0fd17d45f1927a28b4c52ba5146325b1bb0.zip CMake-3b3de0fd17d45f1927a28b4c52ba5146325b1bb0.tar.gz CMake-3b3de0fd17d45f1927a28b4c52ba5146325b1bb0.tar.bz2 |
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.
Diffstat (limited to 'Tests/ObjectLibrary/Transitive')
-rw-r--r-- | Tests/ObjectLibrary/Transitive/CMakeLists.txt | 7 | ||||
-rw-r--r-- | Tests/ObjectLibrary/Transitive/FooObject.c | 4 | ||||
-rw-r--r-- | Tests/ObjectLibrary/Transitive/FooStatic.c | 4 | ||||
-rw-r--r-- | Tests/ObjectLibrary/Transitive/Transitive.c | 7 |
4 files changed, 22 insertions, 0 deletions
diff --git a/Tests/ObjectLibrary/Transitive/CMakeLists.txt b/Tests/ObjectLibrary/Transitive/CMakeLists.txt new file mode 100644 index 0000000..c0a4ac3 --- /dev/null +++ b/Tests/ObjectLibrary/Transitive/CMakeLists.txt @@ -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) diff --git a/Tests/ObjectLibrary/Transitive/FooObject.c b/Tests/ObjectLibrary/Transitive/FooObject.c new file mode 100644 index 0000000..54c1f29 --- /dev/null +++ b/Tests/ObjectLibrary/Transitive/FooObject.c @@ -0,0 +1,4 @@ +int FooObject(void) +{ + return 0; +} diff --git a/Tests/ObjectLibrary/Transitive/FooStatic.c b/Tests/ObjectLibrary/Transitive/FooStatic.c new file mode 100644 index 0000000..84649c7 --- /dev/null +++ b/Tests/ObjectLibrary/Transitive/FooStatic.c @@ -0,0 +1,4 @@ +int FooStatic(void) +{ + return 0; +} diff --git a/Tests/ObjectLibrary/Transitive/Transitive.c b/Tests/ObjectLibrary/Transitive/Transitive.c new file mode 100644 index 0000000..43089b8 --- /dev/null +++ b/Tests/ObjectLibrary/Transitive/Transitive.c @@ -0,0 +1,7 @@ +extern int FooObject(void); +extern int FooStatic(void); + +int main(void) +{ + return FooObject() + FooStatic(); +} |