llvm.org GIT mirror llvm / 3ee8690
[CMake] Adjust export_executable_symbols to cope with non-target link libraries export_executable_symbols looks though the link libraries of the executable in order to figure out transitive dependencies, but in doing so it assumes that all link libraries are also targets. This is not true as of r273302, so adjust it to check if they actually are targets. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274546 91177308-0d34-0410-b5e6-96231b3b80d8 John Brawn 4 years ago
1 changed file(s) with 15 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
694694 set(link_libs ${new_libs})
695695 while(NOT "${new_libs}" STREQUAL "")
696696 foreach(lib ${new_libs})
697 get_target_property(lib_type ${lib} TYPE)
698 if("${lib_type}" STREQUAL "STATIC_LIBRARY")
699 list(APPEND static_libs ${lib})
700 else()
701 list(APPEND other_libs ${lib})
697 if(TARGET ${lib})
698 get_target_property(lib_type ${lib} TYPE)
699 if("${lib_type}" STREQUAL "STATIC_LIBRARY")
700 list(APPEND static_libs ${lib})
701 else()
702 list(APPEND other_libs ${lib})
703 endif()
704 get_target_property(transitive_libs ${lib} INTERFACE_LINK_LIBRARIES)
705 foreach(transitive_lib ${transitive_libs})
706 list(FIND link_libs ${transitive_lib} idx)
707 if(TARGET ${transitive_lib} AND idx EQUAL -1)
708 list(APPEND newer_libs ${transitive_lib})
709 list(APPEND link_libs ${transitive_lib})
710 endif()
711 endforeach(transitive_lib)
702712 endif()
703 get_target_property(transitive_libs ${lib} INTERFACE_LINK_LIBRARIES)
704 foreach(transitive_lib ${transitive_libs})
705 list(FIND link_libs ${transitive_lib} idx)
706 if(TARGET ${transitive_lib} AND idx EQUAL -1)
707 list(APPEND newer_libs ${transitive_lib})
708 list(APPEND link_libs ${transitive_lib})
709 endif()
710 endforeach(transitive_lib)
711713 endforeach(lib)
712714 set(new_libs ${newer_libs})
713715 set(newer_libs "")