Revision: 65385
http://sourceforge.net/p/brlcad/code/65385
Author: starseeker
Date: 2015-06-18 15:30:52 +0000 (Thu, 18 Jun 2015)
Log Message:
-----------
Make a stab at a better gethostname test - may or may not need this for ws2_32,
but will probably need it for gethostname...
Modified Paths:
--------------
brlcad/trunk/CMakeLists.txt
Modified: brlcad/trunk/CMakeLists.txt
===================================================================
--- brlcad/trunk/CMakeLists.txt 2015-06-18 15:13:17 UTC (rev 65384)
+++ brlcad/trunk/CMakeLists.txt 2015-06-18 15:30:52 UTC (rev 65385)
@@ -1803,7 +1803,18 @@
if("${HAVE_WS2_32_LIBRARY}" MATCHES "^${HAVE_WS2_32_LIBRARY}$")
set(CMAKE_REQUIRED_LIBRARIES_BAK ${CMAKE_REQUIRED_LIBRARIES})
set(CMAKE_REQUIRED_LIBRARIES "ws2_32.lib")
- check_c_source_runs("#include <windows.h>\nint main() {char name[32];
(void)gethostname(name, 32); return 0;}" HAVE_WS2_32_LIBRARY)
+ check_c_source_runs("
+#include <winsock2.h>
+int main() {
+ char name[32];
+ WORD wVersionRequested = MAKEWORD(1, 1);
+ WSADATA wsaData;
+ WSAStartup(wVersionRequested, &wsaData);
+ (void)gethostname(name, 32);
+ WSACleanup();
+ return 0;
+}
+" HAVE_WS2_32_LIBRARY)
if(HAVE_WS2_32_LIBRARY)
set(WS2_32_LIBRARY "ws2_32.lib")
set(WINSOCK_LIB "ws2_32.lib")
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits