From 32bed5660a70a12f46f1ddb2efc73ac1fbb7c102 Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Sat, 19 Oct 2013 23:05:53 +0200 Subject: [PATCH] WIP win64 support --- indra/cmake/00-Common.cmake | 8 ++++++-- indra/cmake/GooglePerfTools.cmake | 4 ++-- indra/cmake/Variables.cmake | 19 +++++++++++++------ indra/develop.py | 4 ++++ indra/libhacd/hacdHACD.h | 4 +++- 5 files changed, 28 insertions(+), 11 deletions(-) diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index a45c07f69..2229b60ea 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -78,11 +78,15 @@ if (WINDOWS) /W3 /c /Zc:forScope - /Zc:wchar_t- + /Zc:wchar_t- /nologo /Oy- - /arch:SSE2 ) + + # SSE2 is implied on win64 + if (WORD_SIZE EQUAL 32) + add_definitions(/arch:SSE2) + endif (WORD_SIZE EQUAL 32) # configure win32 API for windows XP+ compatibility set(WINVER "0x0501" CACHE STRING "Win32 API Target version (see http://msdn.microsoft.com/en-us/library/aa383745%28v=VS.85%29.aspx)") diff --git a/indra/cmake/GooglePerfTools.cmake b/indra/cmake/GooglePerfTools.cmake index d92c39ded..de669ce08 100644 --- a/indra/cmake/GooglePerfTools.cmake +++ b/indra/cmake/GooglePerfTools.cmake @@ -12,10 +12,10 @@ else (STANDALONE) if (LINUX OR WINDOWS AND NOT WORD_SIZE EQUAL 64) use_prebuilt_binary(gperftools) endif (LINUX OR WINDOWS AND NOT WORD_SIZE EQUAL 64) - if (WINDOWS AND NOT DISABLE_TCMALLOC) + if (WINDOWS AND NOT DISABLE_TCMALLOC AND USE_GOOGLE_PERFTOOLS) set(TCMALLOC_LIBRARIES libtcmalloc_minimal.lib) set(TCMALLOC_LINKER_FLAGS "/INCLUDE:\"__tcmalloc\"") - endif (WINDOWS AND NOT DISABLE_TCMALLOC) + endif (WINDOWS AND NOT DISABLE_TCMALLOC AND USE_GOOGLE_PERFTOOLS) if (LINUX) if(USE_GOOGLE_PERFTOOLS) set(TCMALLOC_LIBRARIES tcmalloc) diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 10dd25ac2..70d025d85 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -37,10 +37,15 @@ set(LIBS_PREBUILT_DIR ${CMAKE_SOURCE_DIR}/../libraries CACHE PATH if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") set(WINDOWS ON BOOL FORCE) - set(ARCH i686) - set(LL_ARCH ${ARCH}_win32) - set(LL_ARCH_DIR ${ARCH}-win32) - set(WORD_SIZE 32) + if (WORD_SIZE EQUAL 32) + set(ARCH i686) + set(LL_ARCH ${ARCH}_win32) + set(LL_ARCH_DIR ${ARCH}-win32) + elseif (WORD_SIZE EQUAL 64) + set(ARCH x86_64) + set(LL_ARCH ${ARCH}_win) + set(LL_ARCH_DIR ${ARCH}-win) + endif (WORD_SIZE EQUAL 32) endif (${CMAKE_SYSTEM_NAME} MATCHES "Windows") if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") @@ -119,15 +124,17 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(LL_ARCH_DIR universal-darwin) endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") -if (WINDOWS) +if (WINDOWS AND WORD_SIZE EQUAL 32) set(PREBUILT_TYPE windows) +elseif (WINDOWS AND WORD_SIZE EQUAL 64) + set(PREBUILT_TYPE windows64) elseif(DARWIN) set(PREBUILT_TYPE darwin) elseif(LINUX AND WORD_SIZE EQUAL 32) set(PREBUILT_TYPE linux) elseif(LINUX AND WORD_SIZE EQUAL 64) set(PREBUILT_TYPE linux64) -endif(WINDOWS) +endif(WINDOWS AND WORD_SIZE EQUAL 32) # Default deploy grid set(GRID agni CACHE STRING "Target Grid") diff --git a/indra/develop.py b/indra/develop.py index c723db053..4e93c27e9 100755 --- a/indra/develop.py +++ b/indra/develop.py @@ -449,6 +449,7 @@ class WindowsSetup(PlatformSetup): 'ver' : r'11.0' } } + gens['vs2010'] = gens['vc100'] gens['vs2012'] = gens['vc110'] @@ -508,6 +509,9 @@ class WindowsSetup(PlatformSetup): project_name=self.project_name, word_size=self.word_size, ) + if self.word_size == 64: + args["generator"] += r' Win64' + #if simple: # return 'cmake %(opts)s "%(dir)s"' % args return ('cmake -G "%(generator)s" ' diff --git a/indra/libhacd/hacdHACD.h b/indra/libhacd/hacdHACD.h index 0c9f11653..f3e0855b8 100644 --- a/indra/libhacd/hacdHACD.h +++ b/indra/libhacd/hacdHACD.h @@ -22,7 +22,9 @@ #include #include #include - +#if defined(_WIN32) && _MSC_VER >= 1700 +#include +#endif namespace HACD { const double sc_pi = 3.14159265;