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

cmake: Use -fstack-protector-strong if possible

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Andreas Schneider
2018-08-31 14:18:02 +02:00
parent 2b05e46b62
commit fc212d73ed

View File

@ -63,10 +63,15 @@ if (UNIX)
endif() endif()
endif() endif()
check_c_compiler_flag_ssp("-fstack-protector" WITH_STACK_PROTECTOR) check_c_compiler_flag_ssp("-fstack-protector-strong" WITH_STACK_PROTECTOR_STRONG)
if (WITH_STACK_PROTECTOR) if (WITH_STACK_PROTECTOR_STRONG)
list(APPEND SUPPORTED_COMPILER_FLAGS "-fstack-protector") list(APPEND SUPPORTED_COMPILER_FLAGS "-fstack-protector-strong")
endif() else (WITH_STACK_PROTECTOR_STRONG)
check_c_compiler_flag_ssp("-fstack-protector" WITH_STACK_PROTECTOR)
if (WITH_STACK_PROTECTOR)
list(APPEND SUPPORTED_COMPILER_FLAGS "-fstack-protector")
endif()
endif (WITH_STACK_PROTECTOR_STRONG)
if (PICKY_DEVELOPER) if (PICKY_DEVELOPER)
add_c_compiler_flag("-Wno-error=deprecated-declarations" SUPPORTED_COMPILER_FLAGS) add_c_compiler_flag("-Wno-error=deprecated-declarations" SUPPORTED_COMPILER_FLAGS)