llvm.org GIT mirror llvm / 8e3864f
CMake: Rely on llvm_config again for obtaining the list of required libraries for an executable. Now LLVMConfig uses a new system for sorting library dependencies, as the list of dependent libraries for each entry of FinalLibDeps.txt no longer is topologically sorted. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78787 91177308-0d34-0410-b5e6-96231b3b80d8 Oscar Fuentes 10 years ago
2 changed file(s) with 9 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
2525 if( LLVM_LINK_COMPONENTS )
2626 llvm_config(${name} ${LLVM_LINK_COMPONENTS})
2727 endif( LLVM_LINK_COMPONENTS )
28 target_link_libraries(${name} ${llvm_libs})
2928 get_system_libs(llvm_system_libs)
3029 if( llvm_system_libs )
3130 target_link_libraries(${name} ${llvm_system_libs})
8080 # We must match capitalization.
8181 string(TOUPPER "${llvm_libs}" capitalized_libs)
8282 list(REMOVE_DUPLICATES expanded_components)
83 set(curr_idx 0)
8483 list(LENGTH expanded_components lst_size)
85 while( ${curr_idx} LESS ${lst_size} )
86 list(GET expanded_components ${curr_idx} c)
84 set(result "")
85 while( 0 LESS ${lst_size} )
86 list(GET expanded_components 0 c)
8787 string(TOUPPER "${c}" capitalized)
8888 list(FIND capitalized_libs ${capitalized} idx)
8989 if( idx LESS 0 )
9090 message(FATAL_ERROR "Library ${c} not found in list of llvm libraries.")
9191 endif( idx LESS 0 )
9292 list(GET llvm_libs ${idx} canonical_lib)
93 list(REMOVE_ITEM result ${canonical_lib})
9394 list(APPEND result ${canonical_lib})
94 list(APPEND result ${MSVC_LIB_DEPS_${canonical_lib}})
95 foreach(c ${MSVC_LIB_DEPS_${canonical_lib}})
96 list(REMOVE_ITEM expanded_components ${c})
97 endforeach()
9598 list(APPEND expanded_components ${MSVC_LIB_DEPS_${canonical_lib}})
96 list(REMOVE_DUPLICATES expanded_components)
99 list(REMOVE_AT expanded_components 0)
97100 list(LENGTH expanded_components lst_size)
98 math(EXPR curr_idx "${curr_idx} + 1")
99 endwhile( ${curr_idx} LESS ${lst_size} )
100 list(REMOVE_DUPLICATES result)
101 endwhile( 0 LESS ${lst_size} )
101102 set(${out_libs} ${result} PARENT_SCOPE)
102103 endfunction(explicit_map_components_to_libraries)