Page MenuHome

Windows: Move msvc from /MT to /MD

Authored by Ray molenkamp (LazyDodo) on Nov 2 2019, 10:07 PM.




  1. No-one seems to remember why we are building with /MT
  2. The thread local vars causing race conditions [1] which is a blocking issue for supporting USD on windows.
  3. We have to ship the CRT libraries anyhow for python.
  4. Intels TBB allocator doesn't like /MT

This patch moves blender over to /MD and moves building of the deps to VS2017 including an new lib folder (win64_vc15) so it should cause minimal disturbance.

Passes the unit tests in both release and debug builds with the same pass-rate as the MT build (one failing test in debug on both builds)

noteworthy changes:

  • yaml-cpp needed a version bump to 0.6.3 build with vs2017
  • OpenCollada needed a similar fix (pull #610) but that hasn't merged in nearly a year so i added it to our patch
  • Both openVDB and OpenColorIO needed a preprocessor define otherwise they defaulted to a dllimport interface which was a warning for the /MT build but a straight up build error with /MD


Diff Detail

rB Blender

Event Timeline

I have a set of libs ready for SVN but did not want to add them before code review.

  • Straighten up linker flags between release and debug

Switching to /MD seems fine to me.

But why 2017 and not 2019?

Also see inlined comment.


Please explain what are the exact issues which are being caused.

Ray molenkamp (LazyDodo) marked an inline comment as done.Nov 4 2019, 2:52 PM

2017 since i'd like to support the last 2 versions of msvc (this implicitly means 2015 will be dropped), the backward compatibility story is pretty great (ie libs made with 2017 will link flawlessly on 2019) in recent VS versions however i'm unsure if the other direction is equally great, and i don't want to take the risk there.


Thought it was clear, but I clarified it a little better.

Well, i think it's totally fine for master.
But what unclear to me is whether you are aiming this for 2.81 as well?



This revision is now accepted and ready to land.Nov 5 2019, 9:32 AM
Ray molenkamp (LazyDodo) marked an inline comment as done.
  • update error message on how to resolve missing libs.
This revision was automatically updated to reflect the committed changes.