1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-25 21:38:59 +02:00

Use additional checks only for non-Windows gcc builds

This commit is contained in:
Ivan Savenko 2024-04-11 13:37:46 +03:00
parent cbd5f57069
commit c1cb6eb67f

View File

@ -393,8 +393,10 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR NOT WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=array-bounds") # false positives in boost::multiarray during release build, keep as warning-only
endif()
# For gcc 14+ we can use -fhardened instead
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FORTIFY_SOURCE=2 -D_GLIBCXX_ASSERTIONS -fstack-protector-strong -fstack-clash-protection -fcf-protection=full")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT WIN32)
# For gcc 14+ we can use -fhardened instead
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FORTIFY_SOURCE=2 -D_GLIBCXX_ASSERTIONS -fstack-protector-strong -fstack-clash-protection -fcf-protection=full")
endif()
# Fix string inspection with lldb
# https://stackoverflow.com/questions/58578615/cannot-inspect-a-stdstring-variable-in-lldb