diff options
author | Ray Molenkamp <github@lazydodo.com> | 2019-11-08 19:01:00 +0300 |
---|---|---|
committer | Ray Molenkamp <github@lazydodo.com> | 2019-11-08 19:01:00 +0300 |
commit | a67aa11b12ec27a1abb9badb513a516c8d90daf5 (patch) | |
tree | 19bb438d8ec845427968f30240c8c846eca156bf /build_files/cmake/platform/platform_win32.cmake | |
parent | e408a62c2a4b1bec44be06b533b20ce9822d92f2 (diff) |
Windows: Switch to the dynamic C runtime
This change switches windows to the dynamic C runtime
avoiding issues coming from mixing the static and dynamic
runtime like the ones outlined in [1]
[1] https://developer.blender.org/D5387#122165
Differential Revision: https://developer.blender.org/D6175
Reviewed by: @Sergey
Diffstat (limited to 'build_files/cmake/platform/platform_win32.cmake')
-rw-r--r-- | build_files/cmake/platform/platform_win32.cmake | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/build_files/cmake/platform/platform_win32.cmake b/build_files/cmake/platform/platform_win32.cmake index e2006be8fc2..9fe5359c5bd 100644 --- a/build_files/cmake/platform/platform_win32.cmake +++ b/build_files/cmake/platform/platform_win32.cmake @@ -151,14 +151,14 @@ else() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /nologo /J /Gd /MP /bigobj") endif() -set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd /ZI") -set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd /ZI") -set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT") -set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT") -set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /MT") -set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} /MT") -set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MT") -set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /MT") +set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd /ZI") +set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MDd /ZI") +set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD") +set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MD") +set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /MD") +set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} /MD") +set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MD") +set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /MD") # JMC is available on msvc 15.8 (1915) and up if(MSVC_VERSION GREATER 1914 AND NOT MSVC_CLANG) @@ -166,7 +166,8 @@ if(MSVC_VERSION GREATER 1914 AND NOT MSVC_CLANG) endif() set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO ") -set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcmrt.lib /NODEFAULTLIB:msvcurt.lib /NODEFAULTLIB:msvcrtd.lib ") +set(PLATFORM_LINKFLAGS_RELEASE "/NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:msvcrtd.lib") +set(PLATFORM_LINKFLAGS_DEBUG "${PLATFORM_LINKFLAGS_DEBUG} /IGNORE:4099 /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:libcmtd.lib") # Ignore meaningless for us linker warnings. set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /ignore:4049 /ignore:4217 /ignore:4221") @@ -178,8 +179,6 @@ else() set(PLATFORM_LINKFLAGS "/MACHINE:IX86 /LARGEADDRESSAWARE ${PLATFORM_LINKFLAGS}") endif() -set(PLATFORM_LINKFLAGS_DEBUG "${PLATFORM_LINKFLAGS_DEBUG} /IGNORE:4099 /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libc.lib") - if(NOT DEFINED LIBDIR) # Setup 64bit and 64bit windows systems @@ -192,22 +191,19 @@ if(NOT DEFINED LIBDIR) # Can be 1910..1912 if(MSVC_VERSION GREATER 1919) message(STATUS "Visual Studio 2019 detected.") - set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc14) + set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc15) elseif(MSVC_VERSION GREATER 1909) message(STATUS "Visual Studio 2017 detected.") - set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc14) + set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc15) elseif(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) + set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc15) endif() else() message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}") endif() if(NOT EXISTS "${LIBDIR}/") - message(FATAL_ERROR "Windows requires pre-compiled libs at: '${LIBDIR}'") + message(FATAL_ERROR "\n\nWindows requires pre-compiled libs at: '${LIBDIR}'. Please run `make update` in the blender source folder to obtain them.") endif() # Mark libdir as system headers with a lower warn level, to resolve some warnings @@ -397,8 +393,8 @@ if(WITH_BOOST) set(BOOST_INCLUDE_DIR ${BOOST}/include) set(BOOST_LIBPATH ${BOOST}/lib) if(CMAKE_CL_64) - set(BOOST_POSTFIX "vc140-mt-s-x64-1_68.lib") - set(BOOST_DEBUG_POSTFIX "vc140-mt-sgd-x64-1_68.lib") + set(BOOST_POSTFIX "vc141-mt-x64-1_68.lib") + set(BOOST_DEBUG_POSTFIX "vc141-mt-gd-x64-1_68.lib") endif() set(BOOST_LIBRARIES optimized ${BOOST_LIBPATH}/libboost_date_time-${BOOST_POSTFIX} @@ -503,8 +499,12 @@ if(WITH_OPENIMAGEDENOISE) set(OPENIMAGEDENOISE_LIBPATH ${LIBDIR}/OpenImageDenoise/lib) set(OPENIMAGEDENOISE_INCLUDE_DIRS ${OPENIMAGEDENOISE}/include) set(OPENIMAGEDENOISE_LIBRARIES - optimized ${OPENIMAGEDENOISE_LIBPATH}/OpenImageDenoise.lib ${OPENIMAGEDENOISE_LIBPATH}/common.lib ${OPENIMAGEDENOISE_LIBPATH}/mkldnn.lib - debug ${OPENIMAGEDENOISE_LIBPATH}/OpenImageDenoise_d.lib ${OPENIMAGEDENOISE_LIBPATH}/common_d.lib ${OPENIMAGEDENOISE_LIBPATH}/mkldnn_d.lib) + optimized ${OPENIMAGEDENOISE_LIBPATH}/OpenImageDenoise.lib + optimized ${OPENIMAGEDENOISE_LIBPATH}/common.lib + optimized ${OPENIMAGEDENOISE_LIBPATH}/mkldnn.lib + debug ${OPENIMAGEDENOISE_LIBPATH}/OpenImageDenoise_d.lib + debug ${OPENIMAGEDENOISE_LIBPATH}/common_d.lib + debug ${OPENIMAGEDENOISE_LIBPATH}/mkldnn_d.lib) set(OPENIMAGEDENOISE_DEFINITIONS) endif() |