Browse Source

Merge topic 'werror_space_fix'

cec6f98018 CMakeDetermineCompilerABI: Avoid removing the flag after -Werror

Acked-by: Kitware Robot <[email protected]>
Acked-by: Robert Maynard <[email protected]>
Merge-request: !8518
Brad King 2 years ago
parent
commit
888c235eca
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Modules/CMakeDetermineCompilerABI.cmake

+ 1 - 1
Modules/CMakeDetermineCompilerABI.cmake

@@ -42,7 +42,7 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src)
     __TestCompiler_setTryCompileTargetType()
 
     # Avoid failing ABI detection on warnings.
-    string(REGEX REPLACE "(^| )-Werror([= ][^ ]*)?( |$)" " " CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS}")
+    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