cmake: link against shell32.lib/advapi32.lib

Fixes: #844
Refs: #760 (cmake-vs-autotools)
(cherry picked from commit 69466cde0382ab3df12e3a011720f87af3998081)
This commit is contained in:
Azat Khuzhin 2019-06-26 01:27:20 +03:00 committed by Azat Khuzhin
parent 3660a4cc23
commit c9ce638c84
No known key found for this signature in database
GPG Key ID: B86086848EF8686D

View File

@ -322,7 +322,7 @@ endif()
# Winsock. # Winsock.
if(WIN32) if(WIN32)
set(CMAKE_EXTRA_INCLUDE_FILES winsock2.h ws2tcpip.h) set(CMAKE_EXTRA_INCLUDE_FILES winsock2.h ws2tcpip.h)
set(CMAKE_REQUIRED_LIBRARIES ws2_32.lib) set(CMAKE_REQUIRED_LIBRARIES ws2_32.lib shell32.lib advapi32.lib)
set(CMAKE_REQUIRED_DEFINITIONS -FIwinsock2.h -FIws2tcpip.h) set(CMAKE_REQUIRED_DEFINITIONS -FIwinsock2.h -FIws2tcpip.h)
endif() endif()
if (SOLARIS) if (SOLARIS)
@ -873,7 +873,7 @@ if(WIN32)
list(APPEND HDR_PRIVATE WIN32-Code/getopt.h) list(APPEND HDR_PRIVATE WIN32-Code/getopt.h)
set(EVENT__DNS_USE_FTIME_FOR_ID 1) set(EVENT__DNS_USE_FTIME_FOR_ID 1)
set(LIB_PLATFORM ws2_32) set(LIB_PLATFORM ws2_32 shell32 advapi32)
add_definitions( add_definitions(
-D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS
-D_CRT_NONSTDC_NO_DEPRECATE) -D_CRT_NONSTDC_NO_DEPRECATE)