Bläddra i källkod

CMake changes for WIN64

LuisAntonRebollo 11 år sedan
förälder
incheckning
6bfb7d8186
2 ändrade filer med 17 tillägg och 2 borttagningar
  1. 12 1
      Tools/CMake/basics.cmake
  2. 5 1
      Tools/CMake/torque3d.cmake

+ 12 - 1
Tools/CMake/basics.cmake

@@ -22,6 +22,12 @@
 
 project("Torque3DEngine")
 
+if( CMAKE_CXX_SIZEOF_DATA_PTR EQUAL 8 )
+    set( TORQUE_CPU_X64 ON )
+elseif( CMAKE_CXX_SIZEOF_DATA_PTR EQUAL 4 )
+    set( TORQUE_CPU_X32 ON )
+endif()
+
 if(NOT TORQUE_TEMPLATE)
     set(TORQUE_TEMPLATE "Full" CACHE STRING "the template to use")
 endif()
@@ -340,7 +346,12 @@ if(WIN32)
     set(TORQUE_CXX_FLAGS_LIBS "/W0" CACHE TYPE STRING)
     mark_as_advanced(TORQUE_CXX_FLAGS_LIBS)
 
-    set(TORQUE_CXX_FLAGS_COMMON "-DUNICODE -D_UNICODE /MP /O2 /Ob2 /Oi /Ot /Oy /GT /Zi /W4 /nologo /GF /EHsc /GS- /Gy- /Qpar- /arch:SSE2 /fp:fast /fp:except- /GR /Zc:wchar_t- /D_CRT_SECURE_NO_WARNINGS" CACHE TYPE STRING)
+    set(TORQUE_CXX_FLAGS_COMMON_DEFAULT "-DUNICODE -D_UNICODE /MP /O2 /Ob2 /Oi /Ot /Oy /GT /Zi /W4 /nologo /GF /EHsc /GS- /Gy- /Qpar- /fp:fast /fp:except- /GR /Zc:wchar_t- /D_CRT_SECURE_NO_WARNINGS" )
+    if( TORQUE_CPU_X32 )
+       set(TORQUE_CXX_FLAGS_COMMON_DEFAULT ${TORQUE_CXX_FLAGS_COMMON_DEFAULT}" /arch:SSE2")
+    endif()
+    set(TORQUE_CXX_FLAGS_COMMON ${TORQUE_CXX_FLAGS_COMMON_DEFAULT} CACHE TYPE STRING)
+    
     mark_as_advanced(TORQUE_CXX_FLAGS_COMMON)
 
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORQUE_CXX_FLAGS_COMMON}")

+ 5 - 1
Tools/CMake/torque3d.cmake

@@ -144,7 +144,11 @@ if(WIN32)
     # warning C4244: 'initializing' : conversion from 'XXX' to 'XXX', possible loss of data
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd4244")
 
-    link_directories($ENV{DXSDK_DIR}/Lib/x86)
+    if( TORQUE_CPU_X64 )
+        link_directories($ENV{DXSDK_DIR}/Lib/x64)
+    else()
+        link_directories($ENV{DXSDK_DIR}/Lib/x86)
+    endif()
 endif()
 
 ###############################################################################