From e9efc05ebb45dc1619b827539d8d158596312977 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Thu, 24 Mar 2016 14:22:45 -0400 Subject: [PATCH] fix release build compile with MSVC 2015 (finally) --- Tools/CMake/CMakeLists.txt | 3 +++ Tools/CMake/torque3d.cmake | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/Tools/CMake/CMakeLists.txt b/Tools/CMake/CMakeLists.txt index 741cc6b1c..cdf6e832b 100644 --- a/Tools/CMake/CMakeLists.txt +++ b/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() diff --git a/Tools/CMake/torque3d.cmake b/Tools/CMake/torque3d.cmake index 83cf63623..eff52e2e8 100644 --- a/Tools/CMake/torque3d.cmake +++ b/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)