aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2017-03-31 13:40:51 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2017-03-31 14:20:57 +0200
commit55af5c07a45a0b51c2f7bbe487862f8781ab9c56 (patch)
tree66ecf109a6fef686e5d1e9d70bc25d8d6bbee383
parente6608fc4a3bd5adb27bcebe3e87c9fc3de789375 (diff)
downloadlibnitrokey-55af5c07a45a0b51c2f7bbe487862f8781ab9c56.tar.gz
libnitrokey-55af5c07a45a0b51c2f7bbe487862f8781ab9c56.tar.bz2
Show warnings during the compilation and treat warnings as error
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
-rw-r--r--CMakeLists.txt10
1 files changed, 10 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 09cb023..a1f582a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,6 +28,14 @@ set(CMAKE_CXX_STANDARD 14)
OPTION(LIBNITROKEY_STATIC "Build libnitrokey statically" TRUE)
+OPTION(ERROR_ON_WARNING "Stop compilation on warning found (not supported for MSVC)" ON)
+if (NOT MSVC)
+ add_compile_options(-Wall -Wno-unused-function -Wcast-qual -Woverloaded-virtual)
+ if (ERROR_ON_WARNING)
+ add_compile_options(-Werror)
+ endif()
+endif()
+
OPTION(COMPILE_TESTS "Compile tests" FALSE)
IF (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo)
@@ -122,6 +130,8 @@ IF (COMPILE_TESTS)
ENDIF()
+
+
#SET(CPACK_GENERATOR
# "DEB;RPM")
# build a CPack driven installer package