diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2018-08-31 14:18:02 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2018-08-31 14:18:34 +0200 |
commit | fc212d73edb00bb174011b41502f32f436b7fae0 (patch) | |
tree | 5456ef7c9f507e8fef26649d38a2211035ac334f /CompilerChecks.cmake | |
parent | 2b05e46b62e911d937fedcd82abfa2cb2ead855b (diff) | |
download | libssh-fc212d73edb00bb174011b41502f32f436b7fae0.tar.gz libssh-fc212d73edb00bb174011b41502f32f436b7fae0.tar.xz libssh-fc212d73edb00bb174011b41502f32f436b7fae0.zip |
cmake: Use -fstack-protector-strong if possible
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'CompilerChecks.cmake')
-rw-r--r-- | CompilerChecks.cmake | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/CompilerChecks.cmake b/CompilerChecks.cmake index f8a7af14..92460828 100644 --- a/CompilerChecks.cmake +++ b/CompilerChecks.cmake @@ -63,10 +63,15 @@ if (UNIX) endif() endif() - check_c_compiler_flag_ssp("-fstack-protector" WITH_STACK_PROTECTOR) - if (WITH_STACK_PROTECTOR) - list(APPEND SUPPORTED_COMPILER_FLAGS "-fstack-protector") - endif() + check_c_compiler_flag_ssp("-fstack-protector-strong" WITH_STACK_PROTECTOR_STRONG) + if (WITH_STACK_PROTECTOR_STRONG) + list(APPEND SUPPORTED_COMPILER_FLAGS "-fstack-protector-strong") + 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) add_c_compiler_flag("-Wno-error=deprecated-declarations" SUPPORTED_COMPILER_FLAGS) |