diff options
author | David Rohr <drohr@jwdt.org> | 2020-01-30 22:29:56 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-02-03 22:01:35 (GMT) |
commit | d5895f50c30d9d0d329d23013baf7986d62e00f1 (patch) | |
tree | b1527e2acd5c14a6d24b251f2aa22daa43ee3c0a | |
parent | 3a732a7dc3a2f48f824175ad4727706a14974929 (diff) | |
download | CMake-d5895f50c30d9d0d329d23013baf7986d62e00f1.zip CMake-d5895f50c30d9d0d329d23013baf7986d62e00f1.tar.gz CMake-d5895f50c30d9d0d329d23013baf7986d62e00f1.tar.bz2 |
CMakeDetermineCompilerABI: Avoid failing on warnings with -Werror
Simply remove `-Werror` flags from `CMAKE_<LANG>_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
-rw-r--r-- | Modules/CMakeDetermineCompilerABI.cmake | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake index 99447e4..e1b3c52 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. |