From: LLVM Packaging Team Date: Sat, 4 Jun 2022 13:30:38 +0000 (+0100) Subject: compilerrt-fix-warn-xray-testing X-Git-Tag: archive/raspbian/1%13.0.1-6+rpi1^2~15 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=3540fddc5b2bb3d3b629be08451f2c89729e8197;p=llvm-toolchain-13.git compilerrt-fix-warn-xray-testing suppress warnings for xray and testing when not enabled Gbp-Pq: Name compilerrt-fix-warn-xray-testing.diff --- diff --git a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake index 5543e3c6af..8cc8d5b8fa 100644 --- a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake +++ b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake @@ -323,15 +323,15 @@ macro(load_llvm_config) # Detect if we have the LLVMXRay and TestingSupport library installed and # available from llvm-config. + set(COMPILER_RT_HAS_LLVMXRAY FALSE) execute_process( COMMAND ${LLVM_CONFIG_PATH} "--ldflags" "--libs" "xray" RESULT_VARIABLE HAD_ERROR OUTPUT_VARIABLE CONFIG_OUTPUT ERROR_QUIET) - if (HAD_ERROR) + if (HAD_ERROR AND COMPILER_RT_BUILD_XRAY) message(WARNING "llvm-config finding xray failed with status ${HAD_ERROR}") - set(COMPILER_RT_HAS_LLVMXRAY FALSE) - else() + elseif(COMPILER_RT_BUILD_XRAY) string(REGEX REPLACE "[ \t]*[\r\n]+[ \t]*" ";" CONFIG_OUTPUT ${CONFIG_OUTPUT}) list(GET CONFIG_OUTPUT 0 LDFLAGS) list(GET CONFIG_OUTPUT 1 LIBLIST) @@ -348,7 +348,7 @@ macro(load_llvm_config) RESULT_VARIABLE HAD_ERROR OUTPUT_VARIABLE CONFIG_OUTPUT ERROR_QUIET) - if (HAD_ERROR) + if (HAD_ERROR AND COMPILER_RT_INCLUDE_TESTS) message(WARNING "llvm-config finding testingsupport failed with status ${HAD_ERROR}") elseif(COMPILER_RT_INCLUDE_TESTS) string(REGEX REPLACE "[ \t]*[\r\n]+[ \t]*" ";" CONFIG_OUTPUT ${CONFIG_OUTPUT})