<div dir="auto">Cmake is already full of do much hardcoded logic / flags and does new releases so frequently (maybe there's some correlation between these two) that adding this would hardly impact upon its quality or maintainability.<div dir="auto"><br></div><div dir="auto">So to that end, hardcoding the default per msvc version so that it's not added unnecessarily, triggering this warning would seem appropriate to me. Either that or disabling this warning with more hard coded flags would also be appropriate.</div><div dir="auto"><br></div><div dir="auto">The current status in not ideal.</div></div><br><div class="gmail_quote"><div dir="ltr">On Sun, Dec 9, 2018, 7:55 AM Mateusz Loskot <<a href="mailto:mateusz@loskot.net">mateusz@loskot.net</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Sun, 9 Dec 2018 at 14:09, Marc CHEVRIER <<a href="mailto:marc.chevrier@gmail.com" target="_blank" rel="noreferrer">marc.chevrier@gmail.com</a>> wrote:<br>
><br>
> I think the discussion is shifting from the initial problem which was unwanted warning « Command line warning D9025: overriding '/W3' with '/W4' ».<br>
<br>
I disagree with your opinion.<br>
Fixing just the warning would be a symptomatic treatment.<br>
<br>
> 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.<br>
<br>
Although I think it is a long shot at something that is (highly)<br>
unlikely to change, YAGNI consideration,<br>
I understand CMake developers may be reluctant to change the long-time defaults.<br>
<br>
> The real question is how to manage cleanly target specific flags overriding global or directory defaults?<br>
<br>
>From end-user point of view (I have not checekd CMake implementation),<br>
I'd either do not explicitly set -W defaults or strip any -W option<br>
prior re-setting<br>
with (possibly) new value passed to target_compile_options.<br>
<br>
Best regards,<br>
-- <br>
Mateusz Loskot, <a href="http://mateusz.loskot.net" rel="noreferrer noreferrer" target="_blank">http://mateusz.loskot.net</a><br>
-- <br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer noreferrer" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer noreferrer" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer noreferrer" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://cmake.org/mailman/listinfo/cmake-developers" rel="noreferrer noreferrer" target="_blank">https://cmake.org/mailman/listinfo/cmake-developers</a><br>
</blockquote></div>