From 506057d20283ee69de4219bffea26d2609cd6809 Mon Sep 17 00:00:00 2001 From: thez3ro Date: Wed, 3 Jan 2018 20:18:45 +0100 Subject: [PATCH] undefine FORTIFY_SOURCE before trying to define it. In case it's already defined by the distro --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a92f018f5..77f4d8624 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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)