diff --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt --- a/llvm/runtimes/CMakeLists.txt +++ b/llvm/runtimes/CMakeLists.txt @@ -105,8 +105,14 @@ string(FIND "${variable_name}" "BUILTINS_${name}" out) if("${out}" EQUAL 0) string(REPLACE "BUILTINS_${name}_" "" new_name ${variable_name}) - string(REPLACE ";" "|" new_value "${${variable_name}}") - list(APPEND ${name}_extra_args "-D${new_name}=${new_value}") + if(new_name STREQUAL CACHE_FILES) + foreach(cache IN LISTS ${variable_name}) + list(APPEND ${name}_extra_args -C ${cache}) + endforeach() + else() + string(REPLACE ";" "|" new_value "${${variable_name}}") + list(APPEND ${name}_extra_args "-D${new_name}=${new_value}") + endif() endif() endforeach() @@ -326,8 +332,14 @@ string(FIND "${variable_name}" "RUNTIMES_${extra_name}_" out) if("${out}" EQUAL 0) string(REPLACE "RUNTIMES_${extra_name}_" "" new_name ${variable_name}) - string(REPLACE ";" "|" new_value "${${variable_name}}") - list(APPEND ${name}_extra_args "-D${new_name}=${new_value}") + if(new_name STREQUAL CACHE_FILES) + foreach(cache IN LISTS ${variable_name}) + list(APPEND ${name}_extra_args -C ${cache}) + endforeach() + else() + string(REPLACE ";" "|" new_value "${${variable_name}}") + list(APPEND ${name}_extra_args "-D${new_name}=${new_value}") + endif() endif() endforeach() endforeach()