(cmake): add option to build with warnings as errors
What does this MR do?
- Added a cmake option
WARNINGS_AS_ERRORS
in sight to build a project in warning as error (/Wx
on MSVC or-Werror
on gcc/clang) - Removed warning in sight project
fwlauncher
- Added this new option
WARNINGS_AS_ERRORS
infwlauncher
project - Change warning level to w4 on Windows (to see unreferenced local variable)
How to test it?
- build
fwlauncher
, there is no more warning, so it's compiled - add a crappy code that produces a warning(*), the compilation of fwlauncher will fail
(*) simple sample of code that produces a warning:
int warning = 0.;
Data
no required data
Some results
on windows, a project with warnings will produce this error:
error C2220: warning treated as error - no 'object' file generated
on macOS or linux, a project with warnings will produce this type of error:
error: unused variable 'bundlePath' [-Werror,-Wunused-variable]
Additional tests to run
-
Build on Windows -
Build on Linux -
Build on macOS
Associated Issue
Closes #313 (closed)
Edited by Emilie WERNERT