]> source.dussan.org Git - tigervnc.git/commitdiff
Restore workaround for CMake's broken 64-bit detection, but in a more
authorPierre Ossman <ossman@cendio.se>
Fri, 4 Mar 2011 14:31:32 +0000 (14:31 +0000)
committerPierre Ossman <ossman@cendio.se>
Fri, 4 Mar 2011 14:31:32 +0000 (14:31 +0000)
generic manner.

git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4322 3789f03b-4d11-0410-bbf8-ca57d06f2519

CMakeLists.txt

index c25f18eecc85636a8450909c0d7b1220fa9288d0..15b1d5ccd121cdfbc1f985398994dd5fe798cf3e 100644 (file)
@@ -51,6 +51,14 @@ if(NOT DEFINED BUILD_WINVNC)
   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