undefine FORTIFY_SOURCE before trying to define it. In case it's already defined by the distro

This commit is contained in:
thez3ro 2018-01-03 20:18:45 +01:00
parent ffddcb5060
commit 506057d202
No known key found for this signature in database
GPG Key ID: F628F9E41DD7C073

View File

@ -129,7 +129,7 @@ endif()
string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER)
if (CMAKE_BUILD_TYPE_LOWER MATCHES "(release|relwithdebinfo|minsizerel)")
add_gcc_compiler_flags("-D_FORTIFY_SOURCE=2")
add_gcc_compiler_flags("-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2")
endif()
check_c_compiler_flag("-Werror=format-security -Werror=implicit-function-declaration" WERROR_C_AVAILABLE)