diff options
author | Peter Wu <peter@lekensteyn.nl> | 2014-11-06 01:32:43 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2014-11-10 09:07:50 +0100 |
commit | 10286f45e7c0813f6122cd8fd957e96a9f921b16 (patch) | |
tree | 0bab74de7c8b128e996e6b1ede960c7487bead93 | |
parent | 7bdfdd09e4ed32eb1ec690087b29a2a4c3a066ca (diff) |
cmake: fix HAVE_GETHOSTNAME definition
Otherwise Curl_gethostname always fails. Windows has gethostname
since Vista according to
http://msdn.microsoft.com/en-us/library/ms738527%28VS.85%29.aspx, but
accordings to byte_bucket's VC 2005 documentation, it is available even
in Windows 95. (possibly after installing a Platform SDK, the
Windows Server 2003 SP1 Platform SDK should be sufficient).
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
-rw-r--r-- | CMake/Platforms/WindowsCache.cmake | 1 | ||||
-rw-r--r-- | CMakeLists.txt | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/CMake/Platforms/WindowsCache.cmake b/CMake/Platforms/WindowsCache.cmake index 53d1c6dd7..6fc2991cd 100644 --- a/CMake/Platforms/WindowsCache.cmake +++ b/CMake/Platforms/WindowsCache.cmake @@ -5,6 +5,7 @@ if(NOT UNIX) set(HAVE_LIBSOCKET 0) set(NOT_NEED_LIBNSL 0) set(HAVE_LIBNSL 0) + set(HAVE_GETHOSTNAME 1) set(HAVE_LIBZ 0) set(HAVE_LIBCRYPTO 0) diff --git a/CMakeLists.txt b/CMakeLists.txt index 45f46ec5e..a325d1c1c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -252,6 +252,8 @@ if(NOT NOT_NEED_LIBNSL) check_library_exists_concat("nsl" gethostbyname HAVE_LIBNSL) endif(NOT NOT_NEED_LIBNSL) +check_function_exists(gethostname HAVE_GETHOSTNAME) + if(WIN32) check_library_exists_concat("ws2_32" getch HAVE_LIBWS2_32) check_library_exists_concat("winmm" getch HAVE_LIBWINMM) |