summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-12-12 13:32:11 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-12-12 13:32:17 (GMT)
commit6a6900f61666977948bffa1409d4633799de323c (patch)
treea0e3ecc319274205b436e5423dfcda850532e5ef /Tests
parent71e74b4ae453473d597ce5a53e2e8e7641dc832a (diff)
parentbab24e782c1bf56ef7263e91e5cf78879699a036 (diff)
downloadCMake-6a6900f61666977948bffa1409d4633799de323c.zip
CMake-6a6900f61666977948bffa1409d4633799de323c.tar.gz
CMake-6a6900f61666977948bffa1409d4633799de323c.tar.bz2
Merge topic 'object-library-link'
bab24e782c target_link_libraries: Propagate dependencies of object libraries Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2725
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/ObjectLibrary/TransitiveDependencies.cmake7
-rw-r--r--Tests/RunCMake/ObjectLibrary/exe2.c6
3 files changed, 14 insertions, 0 deletions
diff --git a/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake b/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake
index c73732f..6ca33b8 100644
--- a/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake
@@ -45,6 +45,7 @@ run_object_lib_build2(LinkObjRHSObject)
run_object_lib_build(LinkObjRHSShared2)
run_object_lib_build(LinkObjRHSStatic2)
run_object_lib_build2(LinkObjRHSObject2)
+run_object_lib_build(TransitiveDependencies)
run_cmake(MissingSource)
run_cmake(ObjWithObj)
diff --git a/Tests/RunCMake/ObjectLibrary/TransitiveDependencies.cmake b/Tests/RunCMake/ObjectLibrary/TransitiveDependencies.cmake
new file mode 100644
index 0000000..e41cf2e
--- /dev/null
+++ b/Tests/RunCMake/ObjectLibrary/TransitiveDependencies.cmake
@@ -0,0 +1,7 @@
+add_library(lib1 STATIC depends_obj0.c)
+add_library(lib2 OBJECT a.c)
+target_link_libraries(lib2 PRIVATE lib1)
+
+add_executable(test exe2.c)
+
+target_link_libraries(test PUBLIC lib2)
diff --git a/Tests/RunCMake/ObjectLibrary/exe2.c b/Tests/RunCMake/ObjectLibrary/exe2.c
new file mode 100644
index 0000000..66e0caf
--- /dev/null
+++ b/Tests/RunCMake/ObjectLibrary/exe2.c
@@ -0,0 +1,6 @@
+extern int myobj_foo(void);
+
+int main(void)
+{
+ return myobj_foo();
+}