<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageBodySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">I think the discussion is shifting from the initial problem which was unwanted warning « Command line warning D9025: overriding '/W3' with '/W4' ».
<div><br /></div>
<div>Changing defaults is not a good idea from my point of view because relying on defaults can be problematic if Microsoft decide to change the default behaviour.</div>
<div><br /></div>
<div>Moreover, removing ‘/W3’ from defaults will remove the warning for this flag but the problem remains for all other flags possibly overloaded.</div>
<div><br /></div>
<div>The real question is how to manage cleanly target specific flags overriding global or directory defaults? And the frustrating thing is that cl.exe do not allow to disable D9025 warning! :(</div>
<div><br /></div>
</div>
<div name="messageReplySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">Le 9 déc. 2018 à 13:32 +0100, Mateusz Loskot <mateusz@loskot.net>, a écrit :<br />
<blockquote type="cite" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #1abc9c;">On Sun, 9 Dec 2018 at 12:14, Craig Scott <craig.scott@crascit.com> wrote:<br />
<blockquote type="cite" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #e67e22;"><br />
From what I understand from a very limited quick search just now,<br />
it seems that /W3 is the default warning level for Visual Studio<br /></blockquote>
<br />
Yes, it is the default level indeed.<br />
<br />
<blockquote type="cite" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #e67e22;">but CMake explicitly adds it as a default compiler flag in CMAKE_<LANG>_FLAGS_INIT.<br />
This makes me wonder if it has always been the default, otherwise it isn't clear why it was deemed necessary to add it.<br /></blockquote>
<br />
Yes, I'd suspect it was added as 'just in case' too eagerly.<br />
<br />
<blockquote type="cite" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #e67e22;">More to the point, unless there's a reason not to, perhaps we could consider removing it from the default flags CMake sets.<br />
I think this would largely address the situation you're describing and shouldn't actually change the behavior of existing projects.<br /></blockquote>
<br />
Yes, it should be removed.<br />
Unless I'm missing an important reason behind the explicit -W3.<br />
<br />
No, "This has been the default since CMake began" [1], is not enough<br />
rationale to keep it.<br />
<br />
In the old times of manual editing of CMAKE_CXX_FLAGS, it was not a huge deal<br />
- in fact, fiddling with CMAKE_CXX_FLAGS was quite canonical way of<br />
doing things..<br />
But with the advent of target_compile_options, the string call<br />
requirement is just unacceptable.<br />
<br />
[1] https://gitlab.kitware.com/cmake/cmake/issues/18317<br />
<br />
<blockquote type="cite" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #e67e22;">I've CC'ed the developer's list and suggest that follow-up discussion should occur there.<br /></blockquote>
<br />
FYI, I've just subscribed to the developer's list.<br />
<br />
Best regards,<br />
--<br />
Mateusz Loskot, http://mateusz.loskot.net<br />
--<br />
<br />
Powered by www.kitware.com<br />
<br />
Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ<br />
<br />
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br />
<br />
CMake Support: http://cmake.org/cmake/help/support.html<br />
CMake Consulting: http://cmake.org/cmake/help/consulting.html<br />
CMake Training Courses: http://cmake.org/cmake/help/training.html<br />
<br />
Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html<br />
<br />
Follow this link to subscribe/unsubscribe:<br />
https://cmake.org/mailman/listinfo/cmake<br /></blockquote>
<div></div>
</div>
</body>
</html>