[Bf-blender-cvs] [c7b00ef625f] master: MSVC: Fix cmake warnings with MSVC updates

Ray Molenkamp noreply at git.blender.org
Thu Sep 3 20:39:55 CEST 2020


Commit: c7b00ef625f174199c2e173026a4ec5d7e57c2ec
Author: Ray Molenkamp
Date:   Thu Sep 3 12:39:49 2020 -0600
Branches: master
https://developer.blender.org/rBc7b00ef625f174199c2e173026a4ec5d7e57c2ec

MSVC: Fix cmake warnings with MSVC updates

CMake caches the location of the CRT runtime in the
MSVC_REDIST_DIR variable, and uses it to copy the required
dll's during the install phase.

This variable is only initialized when it does not exist.
Leading to issues when compiler updates are installed and
the compiler version slightly changes, cmake still looks
in the old location for the runtime and warns about the
files not existing.

This change fixes the issue by checking if the redist dir
exists and if not unsets it so InstallRequiredSystemLibraries
can have another go at figuring out where they live.

===================================================================

M	build_files/cmake/platform/platform_win32_bundle_crt.cmake

===================================================================

diff --git a/build_files/cmake/platform/platform_win32_bundle_crt.cmake b/build_files/cmake/platform/platform_win32_bundle_crt.cmake
index abadaa112a2..29ecb8d5afa 100644
--- a/build_files/cmake/platform/platform_win32_bundle_crt.cmake
+++ b/build_files/cmake/platform/platform_win32_bundle_crt.cmake
@@ -5,6 +5,14 @@ if(WITH_WINDOWS_BUNDLE_CRT)
   set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
   set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)
   set(CMAKE_INSTALL_OPENMP_LIBRARIES ${WITH_OPENMP})
+
+  # This sometimes can change when updates are installed and the compiler version
+  # changes, so test if it exists and if not, give InstallRequiredSystemLibraries
+  # another chance to figure out the path.
+  if(MSVC_REDIST_DIR AND NOT EXISTS "${MSVC_REDIST_DIR}")
+    unset(MSVC_REDIST_DIR CACHE)
+  endif()
+
   include(InstallRequiredSystemLibraries)
 
   # Install the CRT to the blender.crt Sub folder.



More information about the Bf-blender-cvs mailing list