From 1d6c8822ac0c2fcc0454d63999ae178f36b2b0f1 Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Thu, 15 Aug 2024 23:28:01 -0500 Subject: [PATCH] cmake: use _FORTIFY_SOURCE in debug builds Signed-off-by: Kyle Evans --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 611259c..eb0b0af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,7 @@ option(BUILD_DRIVER "Build the porch(1) driver" ON) set(warnings "-Wall -Wextra -Werror") if(CMAKE_BUILD_TYPE STREQUAL "Debug") + add_compile_definitions(_FORTIFY_SOURCE=2) add_compile_options(-fsanitize=address,undefined -fstrict-aliasing) add_link_options(-fsanitize=address,undefined -fstrict-aliasing) endif()