diff options
author | Brad King <brad.king@kitware.com> | 2023-11-14 20:41:17 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-11-14 20:42:07 (GMT) |
commit | d7988ff6b8c10c2c233fc52a65fecebaa0bd2a23 (patch) | |
tree | c9af7823678c63705d65d4dbe3e732f07e99c56e /Tests | |
parent | 1814853081b871dc04e20e0debb2d41055e5cb5c (diff) | |
parent | 50fdaf8f1f6e34d9362b679df0a26d6bbf77c0ba (diff) | |
download | CMake-d7988ff6b8c10c2c233fc52a65fecebaa0bd2a23.zip CMake-d7988ff6b8c10c2c233fc52a65fecebaa0bd2a23.tar.gz CMake-d7988ff6b8c10c2c233fc52a65fecebaa0bd2a23.tar.bz2 |
Merge branch 'backport-target-objects' into target-objects
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/ObjectLibrary/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/ObjectLibrary/TransitiveLinkDeps/CMakeLists.txt | 15 | ||||
-rw-r--r-- | Tests/ObjectLibrary/TransitiveLinkDeps/dep.c | 4 | ||||
-rw-r--r-- | Tests/ObjectLibrary/TransitiveLinkDeps/impl_obj.c | 6 | ||||
-rw-r--r-- | Tests/ObjectLibrary/TransitiveLinkDeps/main.c | 6 |
5 files changed, 33 insertions, 0 deletions
diff --git a/Tests/ObjectLibrary/CMakeLists.txt b/Tests/ObjectLibrary/CMakeLists.txt index b57761b..2bc2327 100644 --- a/Tests/ObjectLibrary/CMakeLists.txt +++ b/Tests/ObjectLibrary/CMakeLists.txt @@ -77,3 +77,5 @@ add_subdirectory(ExportLanguages) add_subdirectory(LinkObjects) add_subdirectory(Transitive) + +add_subdirectory(TransitiveLinkDeps) diff --git a/Tests/ObjectLibrary/TransitiveLinkDeps/CMakeLists.txt b/Tests/ObjectLibrary/TransitiveLinkDeps/CMakeLists.txt new file mode 100644 index 0000000..3f561fa --- /dev/null +++ b/Tests/ObjectLibrary/TransitiveLinkDeps/CMakeLists.txt @@ -0,0 +1,15 @@ +add_library(implgather INTERFACE) + +add_library(dep STATIC dep.c) + +add_library(deps INTERFACE) +target_link_libraries(deps INTERFACE dep) + +add_library(impl_obj OBJECT impl_obj.c) +target_link_libraries(impl_obj PUBLIC deps) + +target_sources(implgather INTERFACE "$<TARGET_OBJECTS:impl_obj>") +target_link_libraries(implgather INTERFACE impl_obj) + +add_executable(useimpl main.c) +target_link_libraries(useimpl PRIVATE implgather) diff --git a/Tests/ObjectLibrary/TransitiveLinkDeps/dep.c b/Tests/ObjectLibrary/TransitiveLinkDeps/dep.c new file mode 100644 index 0000000..7cc62c3 --- /dev/null +++ b/Tests/ObjectLibrary/TransitiveLinkDeps/dep.c @@ -0,0 +1,4 @@ +int from_dep(void) +{ + return 0; +} diff --git a/Tests/ObjectLibrary/TransitiveLinkDeps/impl_obj.c b/Tests/ObjectLibrary/TransitiveLinkDeps/impl_obj.c new file mode 100644 index 0000000..f5760b7 --- /dev/null +++ b/Tests/ObjectLibrary/TransitiveLinkDeps/impl_obj.c @@ -0,0 +1,6 @@ +int from_dep(void); + +int impl_obj(void) +{ + return from_dep(); +} diff --git a/Tests/ObjectLibrary/TransitiveLinkDeps/main.c b/Tests/ObjectLibrary/TransitiveLinkDeps/main.c new file mode 100644 index 0000000..5661f57 --- /dev/null +++ b/Tests/ObjectLibrary/TransitiveLinkDeps/main.c @@ -0,0 +1,6 @@ +int impl_obj(void); + +int main(int argc, char* argv[]) +{ + return impl_obj(); +} |