Files
CMake/Tests/RunCMake/ObjectLibrary/LinkObjRHSObject.cmake
Deniz Bahadir 9a7f039ee7 objlib: Allow OBJECT libraries to link to OBJECT libraries.
Note: This still does not link the object-files of the `OBJECT` library
from the right-hand side of `target_link_libraries` to the target on the
left-hand side. (In this particular case of another `OBJECT` library on
the left-hand side this would not make any sense anyway. The target on
the left-hand side has no link-step.)

Issue: #14778
2018-03-01 09:24:25 -05:00

13 lines
301 B
CMake

cmake_policy(SET CMP0022 NEW)
enable_language(C)
add_library(AnObjLib OBJECT a.c)
target_compile_definitions(AnObjLib INTERFACE REQUIRED)
add_library(AnotherObjLib OBJECT b.c)
target_link_libraries(AnotherObjLib PRIVATE AnObjLib)
add_executable(exe exe.c)
target_link_libraries(exe AnotherObjLib)