diff --git a/CMakeLists.txt b/CMakeLists.txt index 1cf5d1c4620..354e4adb0d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1291,13 +1291,22 @@ elseif(WIN32) set(PLATFORM_LINKFLAGS_DEBUG "/IGNORE:4099 /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libc.lib") if(NOT DEFINED LIBDIR) + # Setup 64bit and 64bit windows systems if(CMAKE_CL_64) message(STATUS "64 bit compiler detected.") - set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/win64_vc12) + set(LIBDIR_BASE "win64") else() message(STATUS "32 bit compiler detected.") - set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/windows_vc12) + set(LIBDIR_BASE "windows") + endif() + + if(MSVC_VERSION EQUAL 1900) + message(STATUS "Visual Studio 2015 detected.") + set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc14) + else() + message(STATUS "Visual Studio 2013 detected.") + set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc12) endif() else() message(STATUS using LIBDIR ${LIBDIR}) diff --git a/source/blender/blenlib/BLI_winstuff.h b/source/blender/blenlib/BLI_winstuff.h index 8cf6f188e19..b421b7dbb90 100644 --- a/source/blender/blenlib/BLI_winstuff.h +++ b/source/blender/blenlib/BLI_winstuff.h @@ -90,7 +90,9 @@ extern "C" { #endif /* defines for using ISO C++ conformant names */ -#define snprintf _snprintf +#if !defined(_MSC_VER) || _MSC_VER < 1900 +# define snprintf _snprintf +#endif #if defined(_MSC_VER) || (defined(FREE_WINDOWS) && !defined(FREE_WINDOWS64)) # define R_OK 4