[ITK] ITKModuleMacros.cmake macro(itk_module_warnings_disable) MSVC warning D9025: overriding '/W1' with '/w'
Michael Jackson
mike.jackson at bluequartz.net
Wed Feb 18 14:08:14 EST 2015
I have seen this when building ITK 4.7.0 with Visual Studio 2013 SP4.
Mike Jackson
> Niels Dekker <mailto:niels-xtk at xs4all.nl>
> Tuesday, February 17, 2015 10:54 AM
> Floris Berendsen and I encountered many (5O+) 'D9025' warnings when we
> built ITK on Visual Studio. The warning message text says:
>
> cl : Command line warning D9025: overriding '/W1' with '/w'
>
> Do other Visual Studio users also get these warnings, when compiling ITK?
> We don't see them at the dashboard,
> https://open.cdash.org/index.php?project=Insight
>
> It appears that the warnings are triggered by the macro
> 'itk_module_warnings_disable', ironically. This macro from
> "ITKModuleMacros.cmake" adds "-w" to the compiler flags. Visual Studio
> automatically adds "/W1" as well, which causes the compiler warning. It
> appears that the warning can be avoided by a very small modification in
> itk_module_warnings_disable: use "/W0" instead of "-w", in
> ITKModuleMacros.cmake:
>
> foreach(lang ${ARGN})
> if(MSVC)
> string(REGEX REPLACE "(^| )[/-]W[0-4]( |$)" " "
> - CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} -w")
> + CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} /W0")
>
> "/W0" has the same meaning as "/w", see
> https://msdn.microsoft.com/en-us/library/thxezb7y.aspx But it appears
> that when itk_module_warnings_disable adds "/W0", instead of "-w", we
> don't get those 'D9025' warnings.
>
> We saw this issue on both Visual Studio 2010 and Visual Studio 2013
> (Update 4), and various versions of CMake, including the latest release,
> CMake 3.1.3. We tried the ITK version from ITK.git.
>
> Kind regards, Niels
--
Sent with Postbox <http://www.getpostbox.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20150218/9ca2dbff/attachment-0001.html>
More information about the Community
mailing list