mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-01 11:22:21 -06:00
Note: This finally links the object-files of the `OBJECT` library from the right-hand side of `target_link_libraries` to the target on the left-hand side. However, this will only happen with directly linked `OBJECT` libraries, not with `OBJECT` libraries "linked" through property `INTERFACE_LINK_LIBRARIES` of a target on the right-hand side! Fixes: #14778
12 lines
332 B
CMake
12 lines
332 B
CMake
enable_language(C)
|
|
|
|
add_library(AnObjLib OBJECT a.c)
|
|
target_compile_definitions(AnObjLib INTERFACE REQUIRED)
|
|
|
|
add_library(A STATIC b.c)
|
|
target_link_libraries(A PRIVATE AnObjLib)
|
|
target_compile_definitions(A INTERFACE $<TARGET_PROPERTY:AnObjLib,INTERFACE_COMPILE_DEFINITIONS>)
|
|
|
|
add_executable(exe exe.c)
|
|
target_link_libraries(exe A)
|