1
0
Fork 0

Fix 887b912af: MinGW requires an extra link flag with _FORTIFY_SOURCE (#8246)

see #7860
pull/8247/head
glx22 2020-06-28 01:18:28 +02:00 committed by GitHub
parent 218db00c4c
commit 63d20c029b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -33,6 +33,11 @@ macro(compile_flags)
"$<$<CONFIG:Debug>:-D_DEBUG>"
"$<$<NOT:$<CONFIG:Debug>>:-D_FORTIFY_SOURCE=2>" # FORTIFY_SOURCE should only be used in non-debug builds (requires -O1+)
)
if (MINGW)
add_link_options(
"$<$<NOT:$<CONFIG:Debug>>:-fstack-protector>" # Prevent undefined references when _FORTIFY_SOURCE > 0
)
endif (MINGW)
# Prepare a generator that checks if we are not a debug, and don't have asserts
# on. We need this later on to set some compile options for stable releases.