TheLartians / ModernCppStarter

🚀 Kick-start your C++! A template for modern C++ projects using CMake, CI, code coverage, clang-format, reproducible dependency management and much more.
https://thelartians.github.io/ModernCppStarter
The Unlicense
4.33k stars 381 forks source link

add and use WarningsAsErrors cmake module (#3) #152

Closed ClausKlein closed 1 year ago

ClausKlein commented 2 years ago

export cxx_std_20 with target_compile_features() but do not export pedantic Warning options!

TheLartians commented 2 years ago

Hey, thanks for the PR!

TBH I'm not very sure about using warnings as errors globally, as it could prevent users from using your library or introduce backwards compatibility problems as warnings may differ a lot between platforms and compiler versions.

Adding the warnings as errors was purposely used only in the tests path, as the feature is intended for the library developers to detect any unexpected warnings and should not to impact any users down the line.