diff --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt --- a/llvm/runtimes/CMakeLists.txt +++ b/llvm/runtimes/CMakeLists.txt @@ -462,14 +462,16 @@ list(APPEND ${name}_extra_args "-D${new_name}=${new_value}") endif() endforeach() - foreach(variableName ${variableNames}) - string(FIND "${variableName}" "RUNTIMES_${name}_" out) - if("${out}" EQUAL 0) - string(REPLACE "RUNTIMES_${name}_" "" new_name ${variableName}) - string(REPLACE ";" "|" new_value "${${variableName}}") - list(APPEND ${name}_extra_args "-D${new_name}=${new_value}") - endif() - endforeach() + if(NOT "${name}" STREQUAL "${target}") + foreach(variableName ${variableNames}) + string(FIND "${variableName}" "RUNTIMES_${name}_" out) + if("${out}" EQUAL 0) + string(REPLACE "RUNTIMES_${name}_" "" new_name ${variableName}) + string(REPLACE ";" "|" new_value "${${variableName}}") + list(APPEND ${name}_extra_args "-D${new_name}=${new_value}") + endif() + endforeach() + endif() if(NOT RUNTIMES_${name}_LLVM_ENABLE_RUNTIMES AND NOT RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES) string(REPLACE ";" "|" LLVM_ENABLE_RUNTIMES_PASSTHROUGH "${LLVM_ENABLE_RUNTIMES}")