diff --git a/runtimes/CMakeLists.txt b/runtimes/CMakeLists.txt index f29d601d3fc..e98c61c0ee6 100644 --- a/runtimes/CMakeLists.txt +++ b/runtimes/CMakeLists.txt @@ -448,17 +448,19 @@ else() # if this is included from LLVM's CMake get_cmake_property(variableNames VARIABLES) foreach(variableName ${variableNames}) - string(FIND "${variableName}" "RUNTIMES_${name}_" out) - if("${out}" EQUAL 0) - string(REPLACE "RUNTIMES_${name}_" "" new_name ${variableName}) - list(APPEND ${name}_extra_args "-D${new_name}=${${variableName}}") - endif() string(FIND "${variableName}" "RUNTIMES_${target}_" out) if("${out}" EQUAL 0) string(REPLACE "RUNTIMES_${target}_" "" new_name ${variableName}) list(APPEND ${name}_extra_args "-D${new_name}=${${variableName}}") endif() endforeach() + foreach(variableName ${variableNames}) + string(FIND "${variableName}" "RUNTIMES_${name}_" out) + if("${out}" EQUAL 0) + string(REPLACE "RUNTIMES_${name}_" "" new_name ${variableName}) + list(APPEND ${name}_extra_args "-D${new_name}=${${variableName}}") + endif() + endforeach() if(NOT RUNTIMES_${name}_LLVM_ENABLE_RUNTIMES) string(REPLACE ";" "|" LLVM_ENABLE_RUNTIMES_PASSTHROUGH "${LLVM_ENABLE_RUNTIMES}")