diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2017-03-31 13:40:51 +0200 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2017-03-31 14:20:57 +0200 |
commit | 55af5c07a45a0b51c2f7bbe487862f8781ab9c56 (patch) | |
tree | 66ecf109a6fef686e5d1e9d70bc25d8d6bbee383 /CMakeLists.txt | |
parent | e6608fc4a3bd5adb27bcebe3e87c9fc3de789375 (diff) | |
download | libnitrokey-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>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 10 |
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 |