cmake: do not force use of new signature for target_link_libraries

This commit is contained in:
Renz Christian Bagaporo 2019-07-08 19:14:28 +08:00
parent c3cc096af0
commit 2a5b02097b

View file

@ -295,7 +295,15 @@ macro(__component_set_dependencies reqs type)
foreach(req ${reqs})
if(req IN_LIST build_component_targets)
__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()
endforeach()
endmacro()
@ -312,12 +320,7 @@ macro(__component_set_all_dependencies)
__component_set_dependencies("${priv_reqs}" PRIVATE)
else()
__component_get_property(reqs ${component_target} __REQUIRES)
foreach(req ${reqs})
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()
__component_set_dependencies("${reqs}" INTERFACE)
endif()
endmacro()