Browse Source

Merge pull request #55 from th3flyboy/master

Fixes for Visual Studio 2010 build and Windows 64 bit compile.
Lloyd Weehuizen 13 years ago
parent
commit
1afbf14a6a
2 changed files with 12 additions and 1 deletions
  1. 11 0
      Build/CMakeLists.txt
  2. 1 1
      Source/Core/Math.cpp

+ 11 - 0
Build/CMakeLists.txt

@@ -52,6 +52,17 @@ if(NOT BUILD_SHARED_LIBS)
     add_definitions(-DSTATIC_LIB)
 endif()
 
+#on windows, check for VC10 and fix the multiple compile target issue.
+IF(WIN32)
+  if(MSVC)
+    if(${MSVC_VERSION} STREQUAL 1600 OR ${MSVC_VERSION} STRGREATER 1600)
+      message("Visual Studio 2010 (${MSVC_VERSION}) build fix at play (/FORCE:MULTIPLE)")
+      set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /FORCE:MULTIPLE")
+    endif()
+  endif() 
+ENDIF(WIN32)
+
+
 #===================================
 # Find dependencies ================
 #===================================

+ 1 - 1
Source/Core/Math.cpp

@@ -144,7 +144,7 @@ ROCKETCORE_API int RoundDown(float value)
 // Efficiently truncates a floating-point value into an integer.
 ROCKETCORE_API int RealToInteger(float value)
 {
-#if defined(ROCKET_PLATFORM_WIN32) && !defined(__MINGW32__)
+#if defined(ROCKET_PLATFORM_WIN32) && !defined(_M_X64) && !defined(__amd64__) && !defined(__MINGW32__)
 	int i;
 	_asm
 	{