From 1ad28c758255a9594220c5210bbc6fed26e6da07 Mon Sep 17 00:00:00 2001 From: Greg Bedwell Date: Mon, 13 Nov 2017 12:57:54 +0000 Subject: Allow compiler-rt test targets to work with multi-config CMake generators Multi-config CMake generators need lit to be able to resolve paths of artifacts from previous build steps at lit time, rather than expect them to be fully resolved at CMake time as they may contain the build mode. Differential Revision: https://reviews.llvm.org/D38471 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@318037 91177308-0d34-0410-b5e6-96231b3b80d8 --- cmake/Modules/AddCompilerRT.cmake | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'cmake') diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake index 700c31f16..c50afbcab 100644 --- a/cmake/Modules/AddCompilerRT.cmake +++ b/cmake/Modules/AddCompilerRT.cmake @@ -508,3 +508,14 @@ function(rt_externalize_debuginfo name) message(FATAL_ERROR "COMPILER_RT_EXTERNALIZE_DEBUGINFO isn't implemented for non-darwin platforms!") endif() endfunction() + + +# Configure lit configuration files, including compiler-rt specific variables. +function(configure_compiler_rt_lit_site_cfg input output) + set_llvm_build_mode() + + string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} COMPILER_RT_RESOLVED_TEST_COMPILER ${COMPILER_RT_TEST_COMPILER}) + string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} COMPILER_RT_RESOLVED_LIBRARY_OUTPUT_DIR ${COMPILER_RT_LIBRARY_OUTPUT_DIR}) + + configure_lit_site_cfg(${input} ${output}) +endfunction() -- cgit v1.2.3