diff options
Diffstat (limited to 'cmake')
-rwxr-xr-x | cmake/modules/LLVMConfig.cmake | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/cmake/modules/LLVMConfig.cmake b/cmake/modules/LLVMConfig.cmake index 03a5c37..7d636ea 100755 --- a/cmake/modules/LLVMConfig.cmake +++ b/cmake/modules/LLVMConfig.cmake @@ -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} ) |