diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2018-12-17 16:35:03 +0100 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2018-12-17 16:36:02 +0100 |
commit | f3ce787870d09cc7d28ae1f985d58aa039993bcf (patch) | |
tree | 682e1d042d8c5f4a636066c54195a5e830d02d11 | |
parent | d07e9a1f6e816f4a567a72ffe6d12f55110b025d (diff) |
Avoid a target to link against itself
If you have specified in your project to link against
a project internal library then the cmake templates should
take care to avoid to link a target against itself.
Bug-AGL: SPEC-1997
Change-Id: I6959247ab350474533fb8df1c1e912aa203f36b5
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r-- | src/cmake/cmake.d/03-macros.cmake | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cmake/cmake.d/03-macros.cmake b/src/cmake/cmake.d/03-macros.cmake index 2d961a4..3ca6311 100644 --- a/src/cmake/cmake.d/03-macros.cmake +++ b/src/cmake/cmake.d/03-macros.cmake @@ -365,9 +365,12 @@ macro(project_targets_populate) ${TYPE} STREQUAL "INTERFACE_LIBRARY" OR ${TYPE} STREQUAL "EXECUTABLE" ) - set_property(TARGET ${TARGET} APPEND PROPERTY LINK_LIBRARIES ${link_libraries}) + foreach(linked_lib ${link_libraries}) + if(NOT ${linked_lib} STREQUAL ${TARGET}) + set_property(TARGET ${TARGET} APPEND PROPERTY LINK_LIBRARIES ${linked_lib}) + endif() + endforeach(linked_lib ${${link_libraries}}) endif() - get_target_property(SUBTYPE ${TARGET} LABELS) if(SUBTYPE) get_target_property(P ${TARGET} PREFIX) |