소스 검색

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
KTGH 5 년 전
부모
커밋
8c501022b3
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      CMakeLists.txt

+ 4 - 0
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.
+		$<$<PLATFORM_ID:Windows>:ws2_32>
+		$<$<PLATFORM_ID:Windows>:crypt32>
+		$<$<PLATFORM_ID:Windows>:cryptui>
 )
 
 # We check for the target when using IF_AVAILABLE since it's possible we didn't find it.