cmake: do not force use of new signature for target_link_libraries
This commit is contained in:
parent
c3cc096af0
commit
2a5b02097b
1 changed files with 10 additions and 7 deletions
|
@ -295,7 +295,15 @@ macro(__component_set_dependencies reqs type)
|
||||||
foreach(req ${reqs})
|
foreach(req ${reqs})
|
||||||
if(req IN_LIST build_component_targets)
|
if(req IN_LIST build_component_targets)
|
||||||
__component_get_property(req_lib ${req} COMPONENT_LIB)
|
__component_get_property(req_lib ${req} COMPONENT_LIB)
|
||||||
target_link_libraries(${component_lib} ${type} ${req_lib})
|
if("${type}" STREQUAL "PRIVATE")
|
||||||
|
set_property(TARGET ${component_lib} APPEND PROPERTY LINK_LIBRARIES ${req_lib})
|
||||||
|
set_property(TARGET ${component_lib} APPEND PROPERTY INTERFACE_LINK_LIBRARIES $<LINK_ONLY:${req_lib}>)
|
||||||
|
elseif("${type}" STREQUAL "PUBLIC")
|
||||||
|
set_property(TARGET ${component_lib} APPEND PROPERTY LINK_LIBRARIES ${req_lib})
|
||||||
|
set_property(TARGET ${component_lib} APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${req_lib})
|
||||||
|
else() # INTERFACE
|
||||||
|
set_property(TARGET ${component_lib} APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${req_lib})
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
@ -312,12 +320,7 @@ macro(__component_set_all_dependencies)
|
||||||
__component_set_dependencies("${priv_reqs}" PRIVATE)
|
__component_set_dependencies("${priv_reqs}" PRIVATE)
|
||||||
else()
|
else()
|
||||||
__component_get_property(reqs ${component_target} __REQUIRES)
|
__component_get_property(reqs ${component_target} __REQUIRES)
|
||||||
foreach(req ${reqs})
|
__component_set_dependencies("${reqs}" INTERFACE)
|
||||||
if(req IN_LIST build_component_targets)
|
|
||||||
__component_get_property(req_lib ${req} COMPONENT_LIB)
|
|
||||||
target_link_libraries(${component_lib} INTERFACE ${req_lib})
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue