commit 08f9eaf6d97099128cfdacc24fda098c3302331b parent 292cfe00028a5f653d9fe0bf0651db80646f087b Author: Frederic Cambus <fred@statdns.com> Date: Sat, 24 Oct 2020 12:10:50 +0200 Only enable FORTIFY_SOURCE level 2 for release builds. Diffstat:
M | CMakeLists.txt | | | 3 | ++- |
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt @@ -51,7 +51,8 @@ if(NOT HAVE_STRTONUM) set (SRC ${SRC} compat/strtonum.c) endif() -add_definitions(-D_GNU_SOURCE -D_FORTIFY_SOURCE=2 -Wall -Wextra -std=c99 -pedantic) +set(CMAKE_C_FLAGS_RELEASE "-D_FORTIFY_SOURCE=2") +add_definitions(-D_GNU_SOURCE -Wall -Wextra -std=c99 -pedantic) add_executable(bdf2sfd ${SRC}) install(TARGETS bdf2sfd DESTINATION ${CMAKE_INSTALL_BINDIR})