From ec80b1f414ef65f8a336be2e3270dcc35593f1b4 Mon Sep 17 00:00:00 2001 From: Sergei Nikulov Date: Wed, 24 Dec 2014 00:05:57 +0300 Subject: CMake: fix winsock2 detection on windows Set CMAKE_REQUIRED_DEFINITIONS to include definitions needed to get the winsock2 API from windows.h. Simplify the order of checks to avoid extra conditions. Use check_include_file instead of check_include_file_concat to look for OpenSSL headers. They do not need to participate in a sequence of dependent system headers. Also they may cause winsock.h to be included before ws2tcpip.h, causing the latter to not be detected in the sequence. Reviewed-by: Brad King --- CMake/FindGSS.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'CMake') diff --git a/CMake/FindGSS.cmake b/CMake/FindGSS.cmake index 4986a8e09..dfaeaf307 100644 --- a/CMake/FindGSS.cmake +++ b/CMake/FindGSS.cmake @@ -155,7 +155,7 @@ message(STATUS "LDFLAGS: ${_GSS_LIB_FLAGS}") set(GSS_FLAVOUR "MIT") else() # prevent compiling the header - just check if we can include it - set(CMAKE_REQUIRED_DEFINITIONS "-D__ROKEN_H__") + set(CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -D__ROKEN_H__") check_include_file( "roken.h" _GSS_HAVE_ROKEN_H) check_include_file( "heimdal/roken.h" _GSS_HAVE_HEIMDAL_ROKEN_H) -- cgit v1.2.3