mirror of
https://github.com/curl/curl.git
synced 2026-08-26 10:53:36 +03:00
cmake: apply WIN32_LEAN_AND_MEAN to all feature checks
Enable `WIN32_LEAN_AND_MEAN` for all feature detections on Windows. (Also drop it from individual detections.) Cherry-picked from #15164
This commit is contained in:
parent
8e34505776
commit
dfd36d3ee0
3 changed files with 2 additions and 19 deletions
|
|
@ -166,9 +166,6 @@ int main(void) { return 0; }
|
||||||
#ifdef HAVE_IOCTLSOCKET
|
#ifdef HAVE_IOCTLSOCKET
|
||||||
/* includes start */
|
/* includes start */
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
# ifndef WIN32_LEAN_AND_MEAN
|
|
||||||
# define WIN32_LEAN_AND_MEAN
|
|
||||||
# endif
|
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
int main(void)
|
int main(void)
|
||||||
|
|
@ -185,9 +182,6 @@ int main(void)
|
||||||
#ifdef HAVE_IOCTLSOCKET_CAMEL
|
#ifdef HAVE_IOCTLSOCKET_CAMEL
|
||||||
/* includes start */
|
/* includes start */
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
# ifndef WIN32_LEAN_AND_MEAN
|
|
||||||
# define WIN32_LEAN_AND_MEAN
|
|
||||||
# endif
|
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
int main(void)
|
int main(void)
|
||||||
|
|
@ -203,9 +197,6 @@ int main(void)
|
||||||
#ifdef HAVE_IOCTLSOCKET_CAMEL_FIONBIO
|
#ifdef HAVE_IOCTLSOCKET_CAMEL_FIONBIO
|
||||||
/* includes start */
|
/* includes start */
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
# ifndef WIN32_LEAN_AND_MEAN
|
|
||||||
# define WIN32_LEAN_AND_MEAN
|
|
||||||
# endif
|
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
int main(void)
|
int main(void)
|
||||||
|
|
@ -222,9 +213,6 @@ int main(void)
|
||||||
#ifdef HAVE_IOCTLSOCKET_FIONBIO
|
#ifdef HAVE_IOCTLSOCKET_FIONBIO
|
||||||
/* includes start */
|
/* includes start */
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
# ifndef WIN32_LEAN_AND_MEAN
|
|
||||||
# define WIN32_LEAN_AND_MEAN
|
|
||||||
# endif
|
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
int main(void)
|
int main(void)
|
||||||
|
|
@ -297,9 +285,6 @@ int main(void)
|
||||||
#ifdef HAVE_SETSOCKOPT_SO_NONBLOCK
|
#ifdef HAVE_SETSOCKOPT_SO_NONBLOCK
|
||||||
/* includes start */
|
/* includes start */
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
# ifndef WIN32_LEAN_AND_MEAN
|
|
||||||
# define WIN32_LEAN_AND_MEAN
|
|
||||||
# endif
|
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
/* includes start */
|
/* includes start */
|
||||||
|
|
@ -410,9 +395,6 @@ int main(void)
|
||||||
#ifdef HAVE_WIN32_WINNT
|
#ifdef HAVE_WIN32_WINNT
|
||||||
/* includes start */
|
/* includes start */
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
# ifndef WIN32_LEAN_AND_MEAN
|
|
||||||
# define WIN32_LEAN_AND_MEAN
|
|
||||||
# endif
|
|
||||||
# ifndef NOGDI
|
# ifndef NOGDI
|
||||||
# define NOGDI
|
# define NOGDI
|
||||||
# endif
|
# endif
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,6 @@ if(NOT DEFINED HAVE_STRUCT_SOCKADDR_STORAGE)
|
||||||
unset(CMAKE_EXTRA_INCLUDE_FILES)
|
unset(CMAKE_EXTRA_INCLUDE_FILES)
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set(CMAKE_EXTRA_INCLUDE_FILES "winsock2.h")
|
set(CMAKE_EXTRA_INCLUDE_FILES "winsock2.h")
|
||||||
set(CMAKE_REQUIRED_DEFINITIONS "-DWIN32_LEAN_AND_MEAN")
|
|
||||||
set(CMAKE_REQUIRED_LIBRARIES "ws2_32")
|
set(CMAKE_REQUIRED_LIBRARIES "ws2_32")
|
||||||
elseif(HAVE_SYS_SOCKET_H)
|
elseif(HAVE_SYS_SOCKET_H)
|
||||||
set(CMAKE_EXTRA_INCLUDE_FILES "sys/socket.h")
|
set(CMAKE_EXTRA_INCLUDE_FILES "sys/socket.h")
|
||||||
|
|
|
||||||
|
|
@ -165,6 +165,8 @@ if(WIN32)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
list(APPEND CMAKE_REQUIRED_DEFINITIONS "-DWIN32_LEAN_AND_MEAN") # Apply to all feature checks
|
||||||
|
|
||||||
set(CURL_TARGET_WINDOWS_VERSION "" CACHE STRING "Minimum target Windows version as hex string")
|
set(CURL_TARGET_WINDOWS_VERSION "" CACHE STRING "Minimum target Windows version as hex string")
|
||||||
if(CURL_TARGET_WINDOWS_VERSION)
|
if(CURL_TARGET_WINDOWS_VERSION)
|
||||||
add_definitions("-D_WIN32_WINNT=${CURL_TARGET_WINDOWS_VERSION}")
|
add_definitions("-D_WIN32_WINNT=${CURL_TARGET_WINDOWS_VERSION}")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue