Improve discrimination of unknown libraries from ignored targets on

LLVMConfig.

llvm-svn: 110065
This commit is contained in:
Oscar Fuentes 2010-08-02 21:24:12 +00:00
parent cd9be9a914
commit 38529c57b6

View File

@ -23,8 +23,10 @@ function(is_llvm_target_library library return_var)
string(TOUPPER "${library}" capitalized_lib)
string(TOUPPER "${LLVM_ALL_TARGETS}" targets)
foreach(t ${targets})
if( capitalized_lib STREQUAL "LLVM${t}CODEGEN" OR
if( capitalized_lib STREQUAL "LLVM${t}" OR
capitalized_lib STREQUAL "LLVM${t}CODEGEN" OR
capitalized_lib STREQUAL "LLVM${t}ASMPARSER" OR
capitalized_lib STREQUAL "LLVM${t}ASMPRINTER" OR
capitalized_lib STREQUAL "LLVM${t}DISASSEMBLER" OR
capitalized_lib STREQUAL "LLVM${t}INFO" )
set(${return_var} ON PARENT_SCOPE)
@ -104,22 +106,24 @@ function(explicit_map_components_to_libraries out_libs)
list(GET expanded_components 0 c)
string(TOUPPER "${c}" capitalized)
list(FIND capitalized_libs ${capitalized} idx)
set(add_it ON)
if( idx LESS 0 )
# The library is unkown. Maybe is an ommitted target?
is_llvm_target_library(${c} iltl_result)
if( iltl_result )
break()
else()
if( NOT iltl_result )
message(FATAL_ERROR "Library ${c} not found in list of llvm libraries.")
endif()
set(add_it OFF)
endif( idx LESS 0 )
list(GET llvm_libs ${idx} canonical_lib)
list(REMOVE_ITEM result ${canonical_lib})
list(APPEND result ${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}})
if( add_it )
list(APPEND result ${canonical_lib})
list(APPEND expanded_components ${MSVC_LIB_DEPS_${canonical_lib}})
endif()
list(REMOVE_AT expanded_components 0)
list(LENGTH expanded_components lst_size)
endwhile( 0 LESS ${lst_size} )