diff --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt --- a/llvm/runtimes/CMakeLists.txt +++ b/llvm/runtimes/CMakeLists.txt @@ -343,6 +343,19 @@ endforeach() endif() + # If we're passed any option like RUNTIMES__FOO, pass it through as _FOO. + # For example, RUNTIMES_LIBCXX_TEST_CONFIG will be passed down as LIBCXX_TEST_CONFIG. + foreach(runtime ${LLVM_ENABLE_RUNTIMES}) + string(TOUPPER "${runtime}" runtime_upper) + foreach(variableName ${variableNames}) + if (variableName MATCHES "RUNTIMES_${runtime_upper}_.+") + string(REPLACE "RUNTIMES_" "" new_name "${variableName}") + string(REPLACE ";" "|" new_value "${${variableName}}") + list(APPEND ${name}_extra_args "-D${new_name}=${new_value}") + endif() + endforeach() + endforeach() + if(NOT RUNTIMES_${name}_LLVM_ENABLE_RUNTIMES AND NOT RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES) string(REPLACE ";" "|" LLVM_ENABLE_RUNTIMES_PASSTHROUGH "${LLVM_ENABLE_RUNTIMES}") list(APPEND ${name}_extra_args -DLLVM_ENABLE_RUNTIMES=${LLVM_ENABLE_RUNTIMES_PASSTHROUGH})