From e21f52f437abb18e4210a90d796edce486e50889 Mon Sep 17 00:00:00 2001 From: Peter De Wachter Date: Sun, 19 Apr 2020 21:05:03 +0200 Subject: [PATCH] Tweak compiler flags --- CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bba0828..b1fe7f1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,10 +39,11 @@ endmacro(extra_cxx_compiler_flag) # Compiler warnings extra_cxx_compiler_flag("-Wall") extra_cxx_compiler_flag("-Wno-missing-braces") -# Some security flags +extra_cxx_compiler_flag("-Wdate-time") +# Some hardening flags extra_cxx_compiler_flag("-fstack-protector-strong") extra_cxx_compiler_flag("-Wformat") -extra_cxx_compiler_flag("-Werror=format-security") +extra_cxx_compiler_flag("-Wformat -Werror=format-security") extra_cxx_compiler_flag("-D_FORTIFY_SOURCE=2") # Enable the supported flags, but give priority to CXXFLAGS env var set(CMAKE_CXX_FLAGS "${EXTRA_CXX_FLAGS} ${CMAKE_CXX_FLAGS}")