[CMake] Build with -lssp on MinGW

This commit is contained in:
Martijn van Beurden 2021-12-28 16:50:33 +01:00
parent 617efda90d
commit 805b7dba83
1 changed files with 3 additions and 0 deletions

View File

@ -53,6 +53,7 @@ include(CheckFunctionExists)
include(CheckIncludeFile)
include(CheckCSourceCompiles)
include(CheckCXXSourceCompiles)
include(CheckLibraryExists)
include(GNUInstallDirs)
include(UseSystemExtensions)
include(TestBigEndian)
@ -83,6 +84,8 @@ if(MINGW AND (WITH_FORTIFY_SOURCE OR WITH_STACK_PROTECTOR))
check_library_exists(ssp __stack_chk_fail "" HAVE_LIBSSP)
if(NOT HAVE_LIBSSP)
message(WARNING "Could not find libssp in MinGW, stack protection and/or FORTIFY_SOURCE are unavailable")
else()
link_libraries(ssp)
endif()
elseif(NOT MSVC)
set(HAVE_LIBSSP 1)