summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorMartijn van Beurden <mvanb1@gmail.com>2021-12-28 16:50:33 +0100
committerMartijn van Beurden <mvanb1@gmail.com>2022-04-13 17:37:50 +0200
commit805b7dba834ecf26904a7b21adeee5bab7ad617d (patch)
tree42f8b8c94de318577b53f9776a884f5c1a357c1a /CMakeLists.txt
parent617efda90d046377bb911fb4f30e4f5445b7d781 (diff)
downloadflac-805b7dba834ecf26904a7b21adeee5bab7ad617d.tar.gz
[CMake] Build with -lssp on MinGW
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt3
1 files changed, 3 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c8bc8174..e763008c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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)