1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-07-29 13:01:13 +03:00

cmake: Check for -Werror in ConfigureChecks.cmake

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Andreas Schneider
2018-08-20 16:32:43 +02:00
parent 99a9cf0fcb
commit 26a4097742

View File

@ -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("