Skip to content

Commit

Permalink
cmake: use _FORTIFY_SOURCE in debug builds
Browse files Browse the repository at this point in the history
Signed-off-by: Kyle Evans <[email protected]>
  • Loading branch information
kevans91 committed Sep 19, 2024
1 parent 45fbe9a commit f86ea5d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit f86ea5d

Please sign in to comment.