From 4ead4395854bbbec249d53e8fe6e279128b34a61 Mon Sep 17 00:00:00 2001 From: Puyan Lotfi Date: Tue, 24 Sep 2019 22:38:18 +0000 Subject: [PATCH] Adding support for overriding LLVM_ENABLE_RUNTIMES for runtimes builds. Second attempt: Now with ';' -> '|' replacement. On some platforms, certain runtimes are not supported. For runtimes builds of those platforms it would be nice if we could disable certain runtimes (ie libunwind on Windows). Differential Revision: https://reviews.llvm.org/D67195 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372784 91177308-0d34-0410-b5e6-96231b3b80d8 --- runtimes/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/runtimes/CMakeLists.txt b/runtimes/CMakeLists.txt index 552ab7b2a88..e212c941b6a 100644 --- a/runtimes/CMakeLists.txt +++ b/runtimes/CMakeLists.txt @@ -460,6 +460,11 @@ else() # if this is included from LLVM's CMake endif() endforeach() + if(NOT RUNTIMES_${name}_LLVM_ENABLE_RUNTIMES) + string(REPLACE ";" "|" LLVM_ENABLE_RUNTIMES_PASSTHROUGH "${LLVM_ENABLE_RUNTIMES}") + list(APPEND ${name}_extra_args -DLLVM_ENABLE_RUNTIMES=${LLVM_ENABLE_RUNTIMES_PASSTHROUGH}) + endif() + if(target IN_LIST LLVM_RUNTIME_BUILD_ID_LINK_TARGETS) list(APPEND EXTRA_ARGS STRIP_TOOL ${CMAKE_CURRENT_BINARY_DIR}/llvm-strip-link) endif() @@ -482,7 +487,6 @@ else() # if this is included from LLVM's CMake -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON -DLLVM_RUNTIMES_TARGET=${name} ${${name}_extra_args} - PASSTHROUGH_PREFIXES LLVM_ENABLE_RUNTIMES TOOLCHAIN_TOOLS clang lld llvm-ar llvm-ranlib llvm-nm llvm-objcopy llvm-objdump llvm-strip EXTRA_TARGETS ${${name}_extra_targets} ${${name}_test_targets}