From: Pierre Ossman Date: Tue, 17 Mar 2015 12:36:43 +0000 (+0100) Subject: stop using check_function_exists() for Windows socket functions X-Git-Tag: v1.4.90~27^2~15 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=98af8b1e73b107378dc0005b48c212ab46b0b84f;p=tigervnc.git 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. --- 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)