mirror of
https://github.com/azahar-emu/azahar
synced 2025-11-07 07:29:58 +01:00
cmake: Correctly handle _FORTIFY_SOURCE being pre-defined in CXXFLAGS
This commit is contained in:
parent
cc7625e87c
commit
7c88951845
@ -115,7 +115,10 @@ else()
|
|||||||
-fstack-clash-protection
|
-fstack-clash-protection
|
||||||
)
|
)
|
||||||
|
|
||||||
if (NOT CMAKE_BUILD_TYPE STREQUAL Debug)
|
# If we define _FORTIFY_SOURCE when it is already defined, compilation will fail
|
||||||
|
string(FIND "-D_FORTIFY_SOURCE" ${CMAKE_CXX_FLAGS} FORTIFY_SOURCE_DEFINED)
|
||||||
|
|
||||||
|
if (NOT CMAKE_BUILD_TYPE STREQUAL Debug AND NOT FORTIFY_SOURCE_DEFINED)
|
||||||
# _FORTIFY_SOURCE can't be used without optimizations.
|
# _FORTIFY_SOURCE can't be used without optimizations.
|
||||||
add_compile_options(-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2)
|
add_compile_options(-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user