mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-07-31 00:03:07 +03:00
cmake: Add -Wattributs for configure checks
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@ -273,6 +273,13 @@ int main(void) {
|
|||||||
# For detecting attributes we need to treat warnings as
|
# For detecting attributes we need to treat warnings as
|
||||||
# errors
|
# errors
|
||||||
if (UNIX)
|
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)
|
check_c_compiler_flag("-Werror" REQUIRED_FLAGS_WERROR)
|
||||||
if (REQUIRED_FLAGS_WERROR)
|
if (REQUIRED_FLAGS_WERROR)
|
||||||
set(CMAKE_REQUIRED_FLAGS "-Werror")
|
set(CMAKE_REQUIRED_FLAGS "-Werror")
|
||||||
|
Reference in New Issue
Block a user