Commit 540ece74 authored by Alexander Alekhin's avatar Alexander Alekhin

cmake: support ICC warnings

parent 3fc06f14
......@@ -302,6 +302,7 @@ macro(ocv_warnings_disable)
set(_flag_vars "")
set(_msvc_warnings "")
set(_gxx_warnings "")
set(_icc_warnings "")
foreach(arg ${ARGN})
if(arg MATCHES "^CMAKE_")
list(APPEND _flag_vars ${arg})
......@@ -309,6 +310,8 @@ macro(ocv_warnings_disable)
list(APPEND _msvc_warnings ${arg})
elseif(arg MATCHES "^-W")
list(APPEND _gxx_warnings ${arg})
elseif(arg MATCHES "^-wd" OR arg MATCHES "^-Qwd" OR arg MATCHES "^/Qwd")
list(APPEND _icc_warnings ${arg})
endif()
endforeach()
if(MSVC AND _msvc_warnings AND _flag_vars)
......@@ -331,9 +334,25 @@ macro(ocv_warnings_disable)
endforeach()
endforeach()
endif()
if(CV_ICC AND _icc_warnings AND _flag_vars)
foreach(var ${_flag_vars})
foreach(warning ${_icc_warnings})
if(UNIX)
string(REPLACE "-Qwd" "-wd" warning "${warning}")
else()
string(REPLACE "-wd" "-Qwd" warning "${warning}")
endif()
ocv_check_flag_support(${var} "${warning}" _varname)
if(${_varname})
set(${var} "${${var}} ${warning}")
endif()
endforeach()
endforeach()
endif()
unset(_flag_vars)
unset(_msvc_warnings)
unset(_gxx_warnings)
unset(_icc_warnings)
endif(NOT ENABLE_NOISY_WARNINGS)
endmacro()
......
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