diff options
author | John Brawn <john.brawn@arm.com> | 2016-07-05 13:16:54 +0000 |
---|---|---|
committer | John Brawn <john.brawn@arm.com> | 2016-07-05 13:16:54 +0000 |
commit | 3ee8690d1747b2261e1111059d57c61d876cd75d (patch) | |
tree | 88aef7bb419161d3fa4e98e1da5a2263ea366611 /cmake | |
parent | 723b0782c19c5aa232a82d56dce6020fe73ae593 (diff) |
[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
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/modules/AddLLVM.cmake | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake index ba507ddb56d..9f161ff9572 100644 --- a/cmake/modules/AddLLVM.cmake +++ b/cmake/modules/AddLLVM.cmake @@ -695,20 +695,22 @@ function(export_executable_symbols target) set(link_libs ${new_libs}) while(NOT "${new_libs}" STREQUAL "") foreach(lib ${new_libs}) - get_target_property(lib_type ${lib} TYPE) - if("${lib_type}" STREQUAL "STATIC_LIBRARY") - list(APPEND static_libs ${lib}) - else() - list(APPEND other_libs ${lib}) - endif() - get_target_property(transitive_libs ${lib} INTERFACE_LINK_LIBRARIES) - foreach(transitive_lib ${transitive_libs}) - list(FIND link_libs ${transitive_lib} idx) - if(TARGET ${transitive_lib} AND idx EQUAL -1) - list(APPEND newer_libs ${transitive_lib}) - list(APPEND link_libs ${transitive_lib}) + if(TARGET ${lib}) + get_target_property(lib_type ${lib} TYPE) + if("${lib_type}" STREQUAL "STATIC_LIBRARY") + list(APPEND static_libs ${lib}) + else() + list(APPEND other_libs ${lib}) endif() - endforeach(transitive_lib) + get_target_property(transitive_libs ${lib} INTERFACE_LINK_LIBRARIES) + foreach(transitive_lib ${transitive_libs}) + list(FIND link_libs ${transitive_lib} idx) + if(TARGET ${transitive_lib} AND idx EQUAL -1) + list(APPEND newer_libs ${transitive_lib}) + list(APPEND link_libs ${transitive_lib}) + endif() + endforeach(transitive_lib) + endif() endforeach(lib) set(new_libs ${newer_libs}) set(newer_libs "") |