[cmake-developers] [CMake] [MSVC] Setting warning level on target feels like long-time bug

Ray Donnelly mingw.android at gmail.com
Sun Dec 9 10:02:38 EST 2018


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.

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.

The current status in not ideal.

On Sun, Dec 9, 2018, 7:55 AM Mateusz Loskot <mateusz at loskot.net wrote:

> On Sun, 9 Dec 2018 at 14:09, Marc CHEVRIER <marc.chevrier at gmail.com>
> wrote:
> >
> > I think the discussion is shifting from the initial problem which was
> unwanted warning « Command line warning D9025: overriding '/W3' with '/W4'
> ».
>
> I disagree with your opinion.
> Fixing just the warning would be a symptomatic treatment.
>
> > 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.
>
> Although I think it is a long shot at something that is (highly)
> unlikely to change, YAGNI consideration,
> I understand CMake developers may be reluctant to change the long-time
> defaults.
>
> > The real question is how to manage cleanly target specific flags
> overriding global or directory defaults?
>
> From end-user point of view (I have not checekd CMake implementation),
> I'd either do not explicitly set -W defaults or strip any -W option
> prior re-setting
> with (possibly) new value passed to target_compile_options.
>
> Best regards,
> --
> Mateusz Loskot, http://mateusz.loskot.net
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake-developers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake-developers/attachments/20181209/67c80362/attachment.html>


More information about the cmake-developers mailing list