瀏覽代碼

fix release build compile with MSVC 2015 (finally)

Jeff Hutchinson 9 年之前
父節點
當前提交
e9efc05ebb
共有 2 個文件被更改,包括 10 次插入0 次删除
  1. 3 0
      Tools/CMake/CMakeLists.txt
  2. 7 0
      Tools/CMake/torque3d.cmake

+ 3 - 0
Tools/CMake/CMakeLists.txt

@@ -20,6 +20,9 @@
 # IN THE SOFTWARE.
 # -----------------------------------------------------------------------------
 
+# JTH: We require CMake 3.1.4 for MSVC14 compatibility check
+cmake_minimum_required(VERSION 3.1.4)
+
 include(basics.cmake)
 
 setupVersionNumbers()

+ 7 - 0
Tools/CMake/torque3d.cmake

@@ -541,6 +541,13 @@ if(WIN32)
    if(TORQUE_OPENGL)
       addLib(OpenGL32.lib)
    endif()
+		
+   # JTH: DXSDK is compiled with older runtime, and MSVC 2015+ is when __vsnprintf is undefined.
+   # This is a workaround by linking with the older legacy library functions.
+   # See this for more info: http://stackoverflow.com/a/34230122
+   if (MSVC14)
+      addLib(legacy_stdio_definitions.lib)
+   endif()
 endif()
 
 if(UNIX)