From 8c501022b34050efb81fdb981dd3723bfe071e32 Mon Sep 17 00:00:00 2001 From: KTGH Date: Sun, 26 Jul 2020 12:27:03 -0400 Subject: [PATCH] Fix Cmake build for MinGW (#580) Seems certain targets/hosts failed without these, as "_MSC_VER" is undefined on MinGW, which caused the 'pragma comment(lib "libname")' to fail. Fixes #575 --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index c16397b..5481454 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -181,6 +181,10 @@ target_include_directories(${PROJECT_NAME} ${_INTERFACE_OR_PUBLIC} # Always require threads target_link_libraries(${PROJECT_NAME} ${_INTERFACE_OR_PUBLIC} Threads::Threads + # Needed for Windows libs on Mingw, as the pragma comment(lib, "xyz") aren't triggered. + $<$:ws2_32> + $<$:crypt32> + $<$:cryptui> ) # We check for the target when using IF_AVAILABLE since it's possible we didn't find it.