diff --git a/llvm/cmake/modules/LLVM-Config.cmake b/llvm/cmake/modules/LLVM-Config.cmake --- a/llvm/cmake/modules/LLVM-Config.cmake +++ b/llvm/cmake/modules/LLVM-Config.cmake @@ -134,7 +134,7 @@ endif() foreach(c ${link_components}) # add codegen, asmprinter, asmparser, disassembler - if(${c} IN_LIST LLVM_TARGETS_TO_BUILD) + if("${c}" IN_LIST LLVM_TARGETS_TO_BUILD) if(LLVM${c}CodeGen IN_LIST LLVM_AVAILABLE_LIBS) list(APPEND expanded_components "${c}CodeGen") else() @@ -149,48 +149,48 @@ list(APPEND expanded_components "${c}${subcomponent}") endif() endforeach() - elseif( c STREQUAL "nativecodegen" ) + elseif("${c}" STREQUAL "nativecodegen" ) foreach(subcomponent IN ITEMS CodeGen Desc Info) if(LLVM${LLVM_NATIVE_ARCH}${subcomponent} IN_LIST LLVM_AVAILABLE_LIBS) list(APPEND expanded_components "${LLVM_NATIVE_ARCH}${subcomponent}") endif() endforeach() - elseif( c STREQUAL "AllTargetsCodeGens" ) + elseif("${c}" STREQUAL "AllTargetsCodeGens" ) # Link all the codegens from all the targets foreach(t ${LLVM_TARGETS_TO_BUILD}) if( TARGET LLVM${t}CodeGen) list(APPEND expanded_components "${t}CodeGen") endif() endforeach(t) - elseif( c STREQUAL "AllTargetsAsmParsers" ) + elseif("${c}" STREQUAL "AllTargetsAsmParsers" ) # Link all the asm parsers from all the targets foreach(t ${LLVM_TARGETS_TO_BUILD}) if(LLVM${t}AsmParser IN_LIST LLVM_AVAILABLE_LIBS) list(APPEND expanded_components "${t}AsmParser") endif() endforeach(t) - elseif( c STREQUAL "AllTargetsDescs" ) + elseif( "${c}" STREQUAL "AllTargetsDescs" ) # Link all the descs from all the targets foreach(t ${LLVM_TARGETS_TO_BUILD}) if(LLVM${t}Desc IN_LIST LLVM_AVAILABLE_LIBS) list(APPEND expanded_components "${t}Desc") endif() endforeach(t) - elseif( c STREQUAL "AllTargetsDisassemblers" ) + elseif("${c}" STREQUAL "AllTargetsDisassemblers" ) # Link all the disassemblers from all the targets foreach(t ${LLVM_TARGETS_TO_BUILD}) if(LLVM${t}Disassembler IN_LIST LLVM_AVAILABLE_LIBS) list(APPEND expanded_components "${t}Disassembler") endif() endforeach(t) - elseif( c STREQUAL "AllTargetsInfos" ) + elseif("${c}" STREQUAL "AllTargetsInfos" ) # Link all the infos from all the targets foreach(t ${LLVM_TARGETS_TO_BUILD}) if(LLVM${t}Info IN_LIST LLVM_AVAILABLE_LIBS) list(APPEND expanded_components "${t}Info") endif() endforeach(t) - elseif( c STREQUAL "AllTargetsMCAs" ) + elseif("${c}" STREQUAL "AllTargetsMCAs" ) # Link all the TargetMCAs from all the targets foreach(t ${LLVM_TARGETS_TO_BUILD}) if( TARGET LLVM${t}TargetMCA ) @@ -222,7 +222,7 @@ # process target dependencies. if(NOT LLVM_TARGETS_CONFIGURED) foreach(c ${link_components}) - is_llvm_target_specifier(${c} iltl_result ALL_TARGETS) + is_llvm_target_specifier("${c}" iltl_result ALL_TARGETS) if(iltl_result) message(FATAL_ERROR "Specified target library before target registration is complete.") endif() @@ -250,13 +250,13 @@ if(c_rename) set(c ${c_rename}) endif() - if( c STREQUAL "native" ) + if("${c}" STREQUAL "native" ) # already processed - elseif( c STREQUAL "backend" ) + elseif("${c}" STREQUAL "backend" ) # same case as in `native'. - elseif( c STREQUAL "engine" ) + elseif("${c}" STREQUAL "engine" ) # already processed - elseif( c STREQUAL "all" ) + elseif("${c}" STREQUAL "all" ) get_property(all_components GLOBAL PROPERTY LLVM_COMPONENT_LIBS) list(APPEND expanded_components ${all_components}) else() @@ -265,7 +265,7 @@ list(FIND capitalized_libs LLVM${capitalized} lib_idx) if( lib_idx LESS 0 ) # The component is unknown. Maybe is an omitted target? - is_llvm_target_library(${c} iltl_result OMITTED_TARGETS) + is_llvm_target_library("${c}" iltl_result OMITTED_TARGETS) if(iltl_result) # A missing library to a directly referenced omitted target would be bad. message(FATAL_ERROR "Library '${c}' is a direct reference to a target library for an omitted target.") @@ -280,7 +280,7 @@ list(GET LLVM_AVAILABLE_LIBS ${lib_idx} canonical_lib) list(APPEND expanded_components ${canonical_lib}) endif( lib_idx LESS 0 ) - endif( c STREQUAL "native" ) + endif("${c}" STREQUAL "native" ) endforeach(c) set(${out_libs} ${expanded_components} PARENT_SCOPE)