Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorMarcus Asteborg <maastebo@microsoft.com>2020-07-17 08:40:08 +0300
committerRalph Giles <giles@thaumas.net>2020-08-08 20:10:51 +0300
commitb83dd52868326a401c8578041e3dbea439d53f11 (patch)
treedb81873de562cb5b277b43a9f25c8cade421024b /cmake
parentd4b8707b1460c90682ee91f1283d361b90feddd2 (diff)
cmake - MINGW check for ssp lib and link if security features is enabled
Diffstat (limited to 'cmake')
-rw-r--r--cmake/OpusConfig.cmake12
1 files changed, 12 insertions, 0 deletions
diff --git a/cmake/OpusConfig.cmake b/cmake/OpusConfig.cmake
index 43a66b73..8d19a535 100644
--- a/cmake/OpusConfig.cmake
+++ b/cmake/OpusConfig.cmake
@@ -77,6 +77,18 @@ else()
check_flag(FAST_MATH -ffast-math)
check_flag(STACK_PROTECTOR -fstack-protector-strong)
check_flag(HIDDEN_VISIBILITY -fvisibility=hidden)
+ set(FORTIFY_SOURCE_SUPPORTED 1)
+endif()
+
+if(MINGW)
+ # For MINGW we need to link ssp lib for security features such as
+ # stack protector and fortify_sources
+ check_library_exists(ssp __stack_chk_fail "" HAVE_LIBSSP)
+ if(NOT HAVE_LIBSSP)
+ message(WARNING "Could not find libssp in MinGW, disabling STACK_PROTECTOR and FORTIFY_SOURCE")
+ set(STACK_PROTECTOR_SUPPORTED 0)
+ set(FORTIFY_SOURCE_SUPPORTED 0)
+ endif()
endif()
if(NOT MSVC)