You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[CMake] Change the WARNINGS_AS_ERRORS option from BOOL to STRING
to allow a new mode `SERIOUS_ONLY`.
Modes:
`ON` - All warnings are treated as errors (same as before)
`OFF` - Warnings are not treated as errors (same as before)
`SERIOUS_ONLY` - A subset of "serious" warnings are treated as errors.
Upgrade code is included to upgrade old CMake cache's to use the new
type of `WARNINGS_AS_ERRORS`. We should remove it eventually. The
user's previous setting is preserved when doing this.
Very few warnings are treated as errors for now. Developers can
add more later as they see fit.
Copy file name to clipboardExpand all lines: README-CMake.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -266,6 +266,8 @@ The following useful options can be passed to CMake whilst configuring.
266
266
Disabling this is useful for faster incremental builds. The documentation can be manually built by invoking the ``api_docs`` target.
267
267
*``LINK_TIME_OPTIMIZATION`` - BOOL. If set to ``TRUE`` link time optimization will be enabled.
268
268
*``API_LOG_SYNC`` - BOOL. If set to ``TRUE`` will enable experimental API log sync feature.
269
+
*``WARNINGS_AS_ERRORS`` - STRING. If set to ``TRUE`` compiler warnings will be treated as errors. If set to ``False`` compiler warnings will not be treated as errors.
270
+
If set to ``SERIOUS_ONLY`` a subset of compiler warnings will be treated as errors.
269
271
270
272
On the command line these can be passed to ``cmake`` using the ``-D`` option. In ``ccmake`` and ``cmake-gui`` these can be set in the user interface.
271
273
@@ -381,3 +383,13 @@ It is tempting use file-globbing in ``CMakeLists.txt`` to find a set for files m
381
383
use them as the sources to build a target. This however is a bad idea because it prevents CMake from knowing when it needs to rerun itself. This is why source file names are explicitly listed in the ``CMakeLists.txt`` so that when changes are made the source files used to build a target automatically triggers a rerun of CMake.
382
384
383
385
Long story short. Don't use file globbing.
386
+
387
+
### Serious warning flags
388
+
389
+
By default the `WARNINGS_AS_ERRORS` flag is set to `SERIOUS_ONLY` which means
390
+
some warnings will be treated as errors. These warnings are controlled by the
391
+
relevant `*_WARNINGS_AS_ERRORS` list defined in
392
+
`cmake/compiler_warnings.cmake`.
393
+
394
+
Additional warnings should only be added here if the warnings has no false
0 commit comments