I am aware nobody is going to like this, so if anyone has a better idea, I'm open to suggestions.
Ever since D7649 landed there have been issues on windows, Initially flags for whole archive linking were not set (fixed in D8404) leading to no tests getting linked, but now that the executable properly builds and links we run into the following scenario:
- gtest_discover_tests runs as a post build command (for blender_test) to get a list of tests embedded in the blender_test binary
- This test depends on half of blender, and needs virtually all dlls we have to be inplace before it will run
- These dlls will not get copied until the install phase of the blender target
Which is problematic, now we are seemingly not the first to run into this and in cmake 3.18 they added a DISCOVERY_MODE option for gtest_discover_tests which allows you to move the discovery of the tests to the PRE_Test phase.
however this would require a cmake version bump to 3.18 (Jul 15 2020) for windows.
Somewhat related, we have been playing it very fast and lose with our cmake support, the use of gtest_discover_tests raises the minimal cmake version to at-least 3.10 for all other platforms, yet our cmake_minimum_required is still set to 3.5 which is a straight up lie at this point, we really should re-evaluate this.