diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2018-08-20 16:32:43 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2018-08-20 18:42:03 +0200 |
commit | 26a40977427797c46f89708001b1e37cf5de534e (patch) | |
tree | 86af1d05282ecf1a9cd2d38ae0f5331e4cdde8ce /ConfigureChecks.cmake | |
parent | 99a9cf0fcb1a04aa194fcee5f029163ea69e7506 (diff) | |
download | libssh-26a40977427797c46f89708001b1e37cf5de534e.tar.gz libssh-26a40977427797c46f89708001b1e37cf5de534e.tar.xz libssh-26a40977427797c46f89708001b1e37cf5de534e.zip |
cmake: Check for -Werror in ConfigureChecks.cmake
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'ConfigureChecks.cmake')
-rw-r--r-- | ConfigureChecks.cmake | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 3d6f5662..b89244f6 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -271,7 +271,10 @@ int main(void) { # For detecting attributes we need to treat warnings as # errors if (UNIX) - set(CMAKE_REQUIRED_FLAGS "-Werror") + check_c_compiler_flag("-Werror" REQUIRED_FLAGS_WERROR) + if (REQUIRED_FLAGS_WERROR) + set(CMAKE_REQUIRED_FLAGS "-Werror") + endif() endif (UNIX) check_c_source_compiles(" |