aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2018-08-20 16:03:41 +0200
committerAndreas Schneider <asn@cryptomilk.org>2018-08-20 18:42:03 +0200
commit8855a140cf801e03c0dcf0b5f9d0a8c22f0bd7b8 (patch)
tree22415916255002bb5436f931764303151d01ccb0
parenta9a99fb31f2b5b28a321b1637ed491ef0fdc9b2e (diff)
downloadlibssh-8855a140cf801e03c0dcf0b5f9d0a8c22f0bd7b8.tar.gz
libssh-8855a140cf801e03c0dcf0b5f9d0a8c22f0bd7b8.tar.xz
libssh-8855a140cf801e03c0dcf0b5f9d0a8c22f0bd7b8.zip
cmake: Add support for picky developer flags
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r--CompilerChecks.cmake6
-rw-r--r--DefineOptions.cmake2
2 files changed, 8 insertions, 0 deletions
diff --git a/CompilerChecks.cmake b/CompilerChecks.cmake
index 7219aafc..5762ee15 100644
--- a/CompilerChecks.cmake
+++ b/CompilerChecks.cmake
@@ -48,6 +48,12 @@ if (UNIX)
list(APPEND SUPPORTED_COMPILER_FLAGS "-fstack-protector")
endif()
unset(CMAKE_REQUIRED_FLAGS)
+
+ if (PICKY_DEVELOPER)
+ add_c_compiler_flag("-Werror" SUPPORTED_COMPILER_FLAGS)
+ add_c_compiler_flag("-Wno-error=deprecated-declarations" SUPPORTED_COMPILER_FLAGS)
+ add_c_compiler_flag("-Wno-error=tautological-compare" SUPPORTED_COMPILER_FLAGS)
+ endif()
endif()
if (MSVC)
diff --git a/DefineOptions.cmake b/DefineOptions.cmake
index 3b9e4279..0834acd9 100644
--- a/DefineOptions.cmake
+++ b/DefineOptions.cmake
@@ -19,6 +19,8 @@ option(WITH_NACL "Build with libnacl (curve25519)" ON)
option(WITH_SYMBOL_VERSIONING "Build with symbol versioning" ON)
option(WITH_ABI_BREAK "Allow ABI break" OFF)
option(FUZZ_TESTING "Build with fuzzer for the server" OFF)
+option(PICKY_DEVELOPER "Build with picky developer flags" OFF)
+
if (WITH_ZLIB)
set(WITH_LIBZ ON)
else (WITH_ZLIB)