From 06c99ce73bded55232dad5e7db85bc4740cb45fb Mon Sep 17 00:00:00 2001 From: "Sung, Po Han" Date: Thu, 28 Mar 2024 10:58:07 +0800 Subject: CheckSymbolExists: Avoid removing the flag after -Werror In commit 1ab7c3cd28 (CheckSymbolExists: Work around GCC failure with -pedantic-errors option, 2021-10-22, v3.23.0-rc1~498^2) we used the same code that was fixed by commit cec6f98018 (CMakeDetermineCompilerABI: Avoid removing the flag after -Werror, 2023-05-29, v3.26.5~4^2). Apply the fix to CheckSymbolExists too. --- Modules/CheckSymbolExists.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/CheckSymbolExists.cmake b/Modules/CheckSymbolExists.cmake index 931ed4a..90f91dd 100644 --- a/Modules/CheckSymbolExists.cmake +++ b/Modules/CheckSymbolExists.cmake @@ -76,7 +76,7 @@ endmacro() macro(__CHECK_SYMBOL_EXISTS_FILTER_FLAGS LANG) set(__CMAKE_${LANG}_FLAGS_SAVED "${CMAKE_${LANG}_FLAGS}") - string(REGEX REPLACE "(^| )-Werror([= ][^ ]*)?( |$)" " " CMAKE_${LANG}_FLAGS "${CMAKE_${LANG}_FLAGS}") + string(REGEX REPLACE "(^| )-Werror([= ][^-][^ ]*)?( |$)" " " CMAKE_${LANG}_FLAGS "${CMAKE_${LANG}_FLAGS}") string(REGEX REPLACE "(^| )-pedantic-errors( |$)" " " CMAKE_${LANG}_FLAGS "${CMAKE_${LANG}_FLAGS}") endmacro() -- cgit v0.12