diff options
author | Oscar Fuentes <ofv@wanadoo.es> | 2009-08-12 04:05:26 +0000 |
---|---|---|
committer | Oscar Fuentes <ofv@wanadoo.es> | 2009-08-12 04:05:26 +0000 |
commit | 8e3864f99c65a8f9c7221f732281275f238d71f4 (patch) | |
tree | f0927015caa635b098293041e60128ed8a36eb62 /cmake | |
parent | 9bbdf64c986f3a50e6ed3067b297200d0a876e47 (diff) | |
download | external_llvm-8e3864f99c65a8f9c7221f732281275f238d71f4.zip external_llvm-8e3864f99c65a8f9c7221f732281275f238d71f4.tar.gz external_llvm-8e3864f99c65a8f9c7221f732281275f238d71f4.tar.bz2 |
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
Diffstat (limited to 'cmake')
-rwxr-xr-x | cmake/modules/AddLLVM.cmake | 1 | ||||
-rwxr-xr-x | cmake/modules/LLVMConfig.cmake | 17 |
2 files changed, 9 insertions, 9 deletions
diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake index 660bd70..ded77be 100755 --- a/cmake/modules/AddLLVM.cmake +++ b/cmake/modules/AddLLVM.cmake @@ -26,7 +26,6 @@ macro(add_llvm_executable name) if( LLVM_LINK_COMPONENTS ) llvm_config(${name} ${LLVM_LINK_COMPONENTS}) endif( LLVM_LINK_COMPONENTS ) - target_link_libraries(${name} ${llvm_libs}) get_system_libs(llvm_system_libs) if( llvm_system_libs ) target_link_libraries(${name} ${llvm_system_libs}) diff --git a/cmake/modules/LLVMConfig.cmake b/cmake/modules/LLVMConfig.cmake index 4196d1c..cfb0db8 100755 --- a/cmake/modules/LLVMConfig.cmake +++ b/cmake/modules/LLVMConfig.cmake @@ -81,23 +81,24 @@ function(explicit_map_components_to_libraries out_libs) # We must match capitalization. string(TOUPPER "${llvm_libs}" capitalized_libs) list(REMOVE_DUPLICATES expanded_components) - set(curr_idx 0) list(LENGTH expanded_components lst_size) - while( ${curr_idx} LESS ${lst_size} ) - list(GET expanded_components ${curr_idx} c) + set(result "") + while( 0 LESS ${lst_size} ) + list(GET expanded_components 0 c) string(TOUPPER "${c}" capitalized) list(FIND capitalized_libs ${capitalized} idx) if( idx LESS 0 ) message(FATAL_ERROR "Library ${c} not found in list of llvm libraries.") endif( idx LESS 0 ) list(GET llvm_libs ${idx} canonical_lib) + list(REMOVE_ITEM result ${canonical_lib}) list(APPEND result ${canonical_lib}) - list(APPEND result ${MSVC_LIB_DEPS_${canonical_lib}}) + foreach(c ${MSVC_LIB_DEPS_${canonical_lib}}) + list(REMOVE_ITEM expanded_components ${c}) + endforeach() list(APPEND expanded_components ${MSVC_LIB_DEPS_${canonical_lib}}) - list(REMOVE_DUPLICATES expanded_components) + list(REMOVE_AT expanded_components 0) list(LENGTH expanded_components lst_size) - math(EXPR curr_idx "${curr_idx} + 1") - endwhile( ${curr_idx} LESS ${lst_size} ) - list(REMOVE_DUPLICATES result) + endwhile( 0 LESS ${lst_size} ) set(${out_libs} ${result} PARENT_SCOPE) endfunction(explicit_map_components_to_libraries) |