diff --git a/CMakeLists.txt b/CMakeLists.txt index fd43dd3cd..9588d8100 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1601,7 +1601,11 @@ foreach(target ${TARGETS}) target_compile_options(${target} PRIVATE ${OUR_FLAGS}) endif() if(DEFINE_FORTIFY_SOURCE) - target_compile_definitions(${target} PRIVATE $<$>:_FORTIFY_SOURCE=2>) # Detect some buffer overflows. + if(MINGW) + target_compile_definitions(${target} PRIVATE $<$>:_FORTIFY_SOURCE=0>) # Currently broken in MinGW, see https://sourceforge.net/p/mingw-w64/discussion/723798/thread/b9d24f041f/ + else() + target_compile_definitions(${target} PRIVATE $<$>:_FORTIFY_SOURCE=2>) # Detect some buffer overflows. + endif() endif() endforeach()