Skip to content

Commit

Permalink
Fix: do not add _FORTIFY_SOURCE if already defined
Browse files Browse the repository at this point in the history
  • Loading branch information
jcorporation committed Apr 22, 2024
1 parent 8a3a188 commit 8c906f5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,9 @@ if(CMAKE_BUILD_TYPE MATCHES "(Debug|Release|RelWithDebInfo|MinSizeRel)")

if(NOT MYMPD_ENABLE_ASAN AND NOT MYMPD_ENABLE_UBSAN)
# incompatible with address sanitizers
add_compile_options("-D_FORTIFY_SOURCE=2")
if(NOT CMAKE_C_FLAGS MATCHES "_FORTIFY_SOURCE")
add_compile_options("-D_FORTIFY_SOURCE=2")
endif()
endif()
else()
# if CMAKE_BUILD_TYPE is neither Release nor Debug,
Expand Down

0 comments on commit 8c906f5

Please sign in to comment.