Commit 6fa23f33 authored by Alexander Alekhin's avatar Alexander Alekhin

cmake: fix compiler flags filtering

parent f1dc26d7
......@@ -508,7 +508,7 @@ macro(ocv_warnings_disable)
foreach(var ${_flag_vars})
foreach(warning ${_gxx_warnings})
if(NOT warning MATCHES "^-Wno-")
string(REGEX REPLACE "${warning}(=[^ ]*)?" "" ${var} "${${var}}")
string(REGEX REPLACE "(^|[ ]+)${warning}(=[^ ]*)?([ ]+|$)" " " ${var} "${${var}}")
string(REPLACE "-W" "-Wno-" warning "${warning}")
endif()
ocv_check_flag_support(${var} "${warning}" _varname "")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment