aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2018-09-25 14:35:30 +0200
committerAndreas Schneider <asn@cryptomilk.org>2018-09-25 14:37:25 +0200
commit1d7520b68a5132cec07e5403291a63f300c87a75 (patch)
tree21cb7ade2a85d2c1c700f17e89c68669fd79d294
parent9c37c8c5a53776301c45027aaf3f7a3d0b4730c2 (diff)
downloadlibssh-1d7520b68a5132cec07e5403291a63f300c87a75.tar.gz
libssh-1d7520b68a5132cec07e5403291a63f300c87a75.tar.xz
libssh-1d7520b68a5132cec07e5403291a63f300c87a75.zip
cmake: Add -Wattributs for configure checks
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r--ConfigureChecks.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index de17b850..2ab140db 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -273,6 +273,13 @@ int main(void) {
# For detecting attributes we need to treat warnings as
# errors
if (UNIX)
+ # Get warnings for attributs
+ check_c_compiler_flag("-Wattributs" REQUIRED_FLAGS_WERROR)
+ if (REQUIRED_FLAGS_WERROR)
+ set(CMAKE_REQUIRED_FLAGS "-Wattributes")
+ endif()
+
+ # Turn warnings into errors
check_c_compiler_flag("-Werror" REQUIRED_FLAGS_WERROR)
if (REQUIRED_FLAGS_WERROR)
set(CMAKE_REQUIRED_FLAGS "-Werror")