[CMake] Remove _FORTIFY_SOURCE=1 on not having libssp

Based on some information somewhere on the internet, CMakeLists.txt
sets _FORTIFY_SOURCE=2 when its runtime functions are available and
_FORTIFY_SOURCE=1 when they are not. However, _FORTIFY_SOURCE=1
also requires runtime functions.
This commit is contained in:
Martijn van Beurden 2022-05-16 21:35:12 +02:00
parent 5f4fa0ad73
commit 7e4d8189d8
1 changed files with 1 additions and 3 deletions

View File

@ -160,10 +160,8 @@ add_compile_options(
$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<BOOL:${HAVE_WEFFCXX_FLAG}>>:-Weffc++>
$<$<AND:$<COMPILE_LANGUAGE:C>,$<BOOL:${HAVE_DECL_AFTER_STMT_FLAG}>>:-Wdeclaration-after-statement>)
if(HAVE_LIBSSP) # Implies WITH_FORTIFY_SOURCE
if(WITH_FORTIFY_SOURCE AND HAVE_LIBSSP)
add_definitions(-D_FORTIFY_SOURCE=2)
else(WITH_FORTIFY_SOURCE)
add_definitions(-D_FORTIFY_SOURCE=1)
endif()
if(HAVE_STACK_PROTECTOR_FLAG AND HAVE_LIBSSP)