From 98af8b1e73b107378dc0005b48c212ab46b0b84f Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Tue, 17 Mar 2015 13:36:43 +0100 Subject: [PATCH] stop using check_function_exists() for Windows socket functions It fails to find stdcall functions, so we need to just hard code things based on our minimum Windows requirements. --- CMakeLists.txt | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3f11676e..ee31273d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -254,17 +254,14 @@ set(HAVE_PAM ${ENABLE_PAM}) # Check for socket functions if(WIN32) - set(CMAKE_REQUIRED_LIBRARIES ws2_32) -endif() -check_function_exists(inet_aton HAVE_INET_ATON) -# This might give a false positive on Windows as it is also guarded by -# a version check that we do not satisfy (requires Vista, but we target -# Windows 2000). -if(NOT WIN32) -check_function_exists(inet_pton HAVE_INET_PTON) + # check_function_exists() cannot handle stdcall, so just define things + set(HAVE_INET_ATON 1) + set(HAVE_GETADDRINFO 1) +else() + check_function_exists(inet_aton HAVE_INET_ATON) + check_function_exists(getaddrinfo HAVE_GETADDRINFO) + set(CMAKE_REQUIRED_LIBRARIES) endif() -check_function_exists(getaddrinfo HAVE_GETADDRINFO) -set(CMAKE_REQUIRED_LIBRARIES) # Generate config.h and make sure the source finds it configure_file(config.h.in config.h) -- 2.39.5