From d5895f50c30d9d0d329d23013baf7986d62e00f1 Mon Sep 17 00:00:00 2001 From: David Rohr Date: Thu, 30 Jan 2020 23:29:56 +0100 Subject: CMakeDetermineCompilerABI: Avoid failing on warnings with -Werror Simply remove `-Werror` flags from `CMAKE__FLAGS` to avoid failing ABI detection if there happen to be warnings in the test project. For example, `-Wunused-command-line-argument` warnings are common since the ABI detection project may not exercise all the flags passed by users. Fixes: #20305 --- Modules/CMakeDetermineCompilerABI.cmake | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Modules/CMakeDetermineCompilerABI.cmake') diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake index 99447e41eb..e1b3c523c2 100644 --- a/Modules/CMakeDetermineCompilerABI.cmake +++ b/Modules/CMakeDetermineCompilerABI.cmake @@ -32,6 +32,9 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src) endif() __TestCompiler_setTryCompileTargetType() + # Avoid failing ABI detection on warnings. + string(REGEX REPLACE "(^| )-Werror(=[^ ]*)?( |$)" " " CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS}") + # Save the current LC_ALL, LC_MESSAGES, and LANG environment variables # and set them to "C" that way GCC's "search starts here" text is in # English and we can grok it. -- cgit v1.2.1