PixarAnimationStudios / OpenSubdiv

An Open-Source subdivision surface library.
graphics.pixar.com/opensubdiv
Other
2.89k stars 561 forks source link

MSVC / Treats all compiler warnings as errors #1327

Open francoiscoulon opened 7 months ago

francoiscoulon commented 7 months ago

When compiling with Visual Studio (msvc) warnings are treated as errors which is making compilation fail pretty quickly since with /W3 level there is quite a bunch of warnings (setting CMAKE_COMPILE_WARNING_AS_ERROR doesn't fix the problem ¯\_ (ツ)_/¯ ). It's also not mimicking gcc, clang and icc side, there the flag -Werror is not set.

For "homogeneity" could the /WX be removed or commented out in the MSVC block currently here in the code ?

And if someone has a suggestion to avoid having to fix the CMakelist.txt manually please comment.

Thank you !

davidgyu commented 7 months ago

Filed as internal issue #OSD-434

davidgyu commented 7 months ago

Good point about the inconsistency across mcvc, gcc, icc, etc., though I think we'll want to address this inconsistency by enabling warnings as errors for all of these compilers.

Enabling warnings as errors within the OpenSubdiv build itself helps us catch issues that might affect client code using OpenSubdiv headers within client build systems.

We build with Visual Studio (2015, 2017, 2019, 2022) from the Command Prompt and from the IDE and Ninja as part of our regular development and testing.

Can you share more about when this is causing your builds of OpenSubdiv to fail?

Thanks!