From: LLVM Packaging Team Date: Fri, 17 Feb 2023 11:57:29 +0000 (+0000) Subject: compilerrt-fix-warn-xray-testing X-Git-Tag: archive/raspbian/1%14.0.6-12+rpi1^2~17 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=70a9383fac5c81e299010ad42fa3fca01e487dc8;p=llvm-toolchain-14.git compilerrt-fix-warn-xray-testing suppress warnings for xray and testing when not enabled Gbp-Pq: Topic compiler-rt 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 052095801a..3fdc10551c 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})