From 8d585023108c7f32ffa814c4a045b0133111f6bb Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Fri, 21 Mar 2025 16:04:59 +0100 Subject: Always build with _FORTIFY_SOURCE This is already enabled in Ubuntu and RPM builds, so we might as well enable it everywhere so all developers and users see the same behaviour. --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 75773460..0c0344df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,6 +75,7 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") # Tell the compiler to be stringent +add_compile_definitions(_FORTIFY_SOURCE=2) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wformat=2 -Wvla") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wformat=2 -Wvla") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wzero-as-null-pointer-constant") -- cgit v1.2.3