CMake: Fix build in cygwin (#422)

As cygwin environment has both socket.h and winsock2.h headers check WIN32 not to include the later one here

Fix By: Biswapriyo Nath (@Biswa96)
pull/423/head
Biswapriyo Nath 3 years ago committed by GitHub
parent 6ce842ff93
commit db5dabc74a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      CMakeLists.txt

@ -195,11 +195,14 @@ ELSE ()
ENDIF ()
# Include order matters for these windows files.
# As cygwin environment has both socket.h and winsock2.h
# headers check WIN32 not to include the later one here
IF (WIN32)
CHECK_INCLUDE_FILES ("winsock2.h;windows.h" HAVE_WINSOCK2_H)
CHECK_INCLUDE_FILES ("winsock2.h;ws2tcpip.h;windows.h" HAVE_WS2TCPIP_H)
CHECK_INCLUDE_FILES ("winsock.h;windows.h" HAVE_WINSOCK_H)
CHECK_INCLUDE_FILES (windows.h HAVE_WINDOWS_H)
ENDIF ()
# Set system-specific compiler flags
IF (CMAKE_SYSTEM_NAME STREQUAL "Darwin")

Loading…
Cancel
Save