Restore workaround for CMake's broken 64-bit detection, but in a more
generic manner.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4322 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c25f18e..15b1d5c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -51,6 +51,14 @@
   endif()
 endif()
 
+# CMake 64-bit detection leaves a bit to be desired and is sometimes
+# not properly set. Specifically we see this with mingw64. Try to
+# detect this scenario and fix things.
+if(NOT CMAKE_CL_64 AND CMAKE_SIZEOF_VOID_P MATCHES 8)
+  message(STATUS "WARNING: CMake misdetected 64-bit build. Fixing...")
+  set(CMAKE_CL_64 1)
+endif()
+
 if(MSVC)
   # Use the static C library for all build types
   foreach(var CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE