[CMake] Specifically prefer linking with static libssp

As to have a libFLAC.dll with no additional dependencies, linking
with libssp.a is preferred over linking with libssp.dll.a
This commit is contained in:
Martijn van Beurden 2022-01-05 14:45:51 +01:00
parent 6e3089b9bc
commit 4256c12eac
1 changed files with 2 additions and 2 deletions

View File

@ -82,11 +82,11 @@ check_c_compiler_flag(-mstackrealign HAVE_STACKREALIGN_FLAG)
check_cxx_compiler_flag(-Weffc++ HAVE_WEFFCXX_FLAG)
if(MINGW AND (WITH_FORTIFY_SOURCE OR WITH_STACK_PROTECTOR))
check_library_exists(ssp __stack_chk_fail "" HAVE_LIBSSP)
check_library_exists("ssp.a" __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)
link_libraries("ssp.a")
endif()
elseif(NOT MSVC)
set(HAVE_LIBSSP 1)