]> source.dussan.org Git - tigervnc.git/commitdiff
Fix MinGW build breakage
authorDRC <dcommander@users.sourceforge.net>
Thu, 10 Feb 2011 10:43:05 +0000 (10:43 +0000)
committerDRC <dcommander@users.sourceforge.net>
Thu, 10 Feb 2011 10:43:05 +0000 (10:43 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4282 3789f03b-4d11-0410-bbf8-ca57d06f2519

CMakeLists.txt
common/rdr/CMakeLists.txt
config.h.cmake.in
win/CMakeLists.txt
win/vncviewer/CMakeLists.txt

index 9d5bff7aca1b8f5a53408e5a78884cf01d35aa44..1447ebafc500009f58178f4f882de55555f077e7 100644 (file)
@@ -110,6 +110,8 @@ configure_file(config.h.cmake.in config.h)
 add_definitions(-DHAVE_CONFIG_H)
 include_directories(${CMAKE_BINARY_DIR})
 
+add_definitions(-D_WIN32_IE=0x0500 -D_WIN32_WINNT=0x0500)
+
 add_subdirectory(common)
 add_subdirectory(win)
 
index 8be9679e0ad9341bd80348023efe2e9b81b76562..98a88d292b559a27e84e815e8b0431acca0fb172 100644 (file)
@@ -16,7 +16,7 @@ add_library(rdr STATIC
 
 set(RDR_LIBRARIES zlib os)
 if(GNUTLS_FOUND)
-  set(RDR_LIBRARIES ${RDR_LIBRARIES} ${GNUTLS_LIBRARIES})
+  set(RDR_LIBRARIES ${RDR_LIBRARIES} ${GNUTLS_LIBRARIES} ws2_32)
 endif()
 
 target_link_libraries(rdr ${RDR_LIBRARIES})
index eee0f779ca0765f119f05a7f8cf497f19f2d59ff..6b1ca3d33fe7bf4521610efebc203de52cf60a11 100644 (file)
@@ -6,6 +6,6 @@
 #cmakedefine HAVE_VSNPRINTF
 
 /* MS Visual Studio 2008 and newer doesn't know ssize_t */
-#if defined(HAVE_GNUTLS) && defined(WIN32)
-#define ssize_t long
+#if defined(HAVE_GNUTLS) && defined(WIN32) && !defined(__MINGW32__)
+typedef size_t ssize_t;
 #endif
index c034f6f6d4bdc8023b3452a9b2dcc405f552a7a4..103520aa85e2b010713ec0c1aab9c9e766dd4a08 100644 (file)
@@ -1,5 +1,3 @@
-add_definitions(-D_WIN32_IE=0x0500 -D_WIN32_WINNT=0x0500)
-
 include_directories(${CMAKE_SOURCE_DIR}/common ${CMAKE_SOURCE_DIR}/win)
 
 configure_file(resdefs.h.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/resdefs.h)
index 863e2d07a29f622e50b572a9ad7f29fe7aaba23d..7870a01ec8ec58354c801e74e18c99bab96fd42a 100644 (file)
@@ -20,8 +20,16 @@ add_executable(vncviewer WIN32
   vncviewer.cxx
   vncviewer.rc)
 
-target_link_libraries(vncviewer rfb rfb_win32 Xregion network rdr
-  ws2_32.lib)
+set(VNCVIEWER_LIBRARIES rfb rfb_win32 Xregion network rdr)
+
+# When building with GnuTLS, librdr depends on ws2_32, so in order to make
+# MinGW happy, we need to put ws2_32 in librdr's target_link_libraries string,
+# not here.
+if(NOT GNUTLS_FOUND)
+  set(VNCVIEWER_LIBRARIES ${VNCVIEWER_LIBRARIES} ws2_32)
+endif()
+
+target_link_libraries(vncviewer ${VNCVIEWER_LIBRARIES})
 
 install(TARGETS vncviewer
   RUNTIME DESTINATION .