Skip to content

Commit b0bff24

Browse files
authored
Merge pull request #206 from intel-innersource/rdementi/fortify
set -D_FORTIFY_SOURCE=1 for release builds
2 parents ddbe1ce + c0d5eb2 commit b0bff24

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ if(UNIX) # APPLE, LINUX, FREE_BSD
5252
message(STATUS "CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}")
5353

5454
set(PCM_OPTIONAL_FLAGS "-Wall")
55-
set(CMAKE_CXX_FLAGS_RELEASE "${PCM_OPTIONAL_FLAGS} -O3")
55+
set(CMAKE_CXX_FLAGS_RELEASE "${PCM_OPTIONAL_FLAGS} -O3 -D_FORTIFY_SOURCE=1")
5656
set(CMAKE_CXX_FLAGS_DEBUG "${PCM_OPTIONAL_FLAGS} -O0 -g")
57-
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${PCM_OPTIONAL_FLAGS} -O3 -g")
57+
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${PCM_OPTIONAL_FLAGS} -O3 -g -D_FORTIFY_SOURCE=1")
5858
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
5959
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
6060
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")

0 commit comments

Comments
 (0)