diff --git a/CMakeLists.txt b/CMakeLists.txt index 92fbf476..c8ff6072 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,9 +64,10 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR} ) -# Platform +# Target Platform if (WIN32 OR MINGW OR MSYS OR CYGWIN) set(HOSTOS "windows") + set(GETDNS_ON_WINDOWS 1) elseif (APPLE) set(HOSTOS "macos") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_DARWIN_C_SOURCE") @@ -126,6 +127,7 @@ check_include_file(stdio.h HAVE_STDIO_H) check_include_file(stdlib.h HAVE_STDLIB_H) check_include_file(string.h HAVE_STRING_H) check_include_file(time.h HAVE_TIME_H) +check_include_file(unistd.h HAVE_UNISTD_H) check_include_file(signal.h HAVE_SIGNAL_H) check_include_file(sys/poll.h HAVE_SYS_POLL_H) diff --git a/cmake/include/cmakeconfig.h.in b/cmake/include/cmakeconfig.h.in index 578b5495..ede085aa 100644 --- a/cmake/include/cmakeconfig.h.in +++ b/cmake/include/cmakeconfig.h.in @@ -41,6 +41,7 @@ #cmakedefine HAVE_WINSOCK_H 1 #cmakedefine HAVE_WINSOCK2_H 1 #cmakedefine HAVE_WS2TCPIP_H 1 +#cmakedefine GETDNS_ON_WINDOWS 1 #cmakedefine HAVE_SSL 1 @@ -151,11 +152,25 @@ # define PRIsz "zu" #endif +#ifdef HAVE_STDINT_H #include +#endif + +#ifdef HAVE_STDIO_H #include +#endif + +#ifdef HAVE_UNISTD_H #include +#endif + +#ifdef HAVE_ASSERT_H #include +#endif + +#ifdef HAVE_STRING_H #include +#endif #ifdef __cplusplus extern "C" {