add option to enable more warnings

Sun, 26 Sep 2021 17:58:27 +0200

author
Mike Becker <universe@uap-core.de>
date
Sun, 26 Sep 2021 17:58:27 +0200
changeset 433
f1e4c6dabfb4
parent 432
32679add2a2b
child 434
38ee262e8b94

add option to enable more warnings

CMakeLists.txt file | annotate | diff | comparison | revisions
--- a/CMakeLists.txt	Sun Sep 26 16:12:25 2021 +0200
+++ b/CMakeLists.txt	Sun Sep 26 17:58:27 2021 +0200
@@ -5,6 +5,11 @@
 set(CMAKE_C_STANDARD 11)
 set(CMAKE_C_STANDARD_REQUIRED  99)
 
+option(GCC_MORE_WARNINGS "Enable -Wall -Wextra -pedantic when using gcc." OFF)
+if (GCC_MORE_WARNINGS AND CMAKE_COMPILER_IS_GNUCC)
+    add_compile_options(-Wall -Wextra -pedantic)
+endif()
+
 # Library
 add_subdirectory(src)
 

mercurial