From 7e645bd42d6e9cf403c4b4b7d7eb070c5bb1ebf3 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 27 May 2024 10:47:54 +0200 Subject: Try copying the VC++ runtime files from the redistributable package first --- indra/cmake/Copy3rdPartyLibs.cmake | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index a2ce9eab90..30dee3c6c1 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -98,14 +98,27 @@ if(WINDOWS) set(MSVC_VER 120) elseif (MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1920) # Visual Studio 2017 set(MSVC_VER 140) + set(MSVC_TOOLSET_VER 141) elseif (MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS 1930) # Visual Studio 2019 set(MSVC_VER 140) - elseif (MSVC_VERSION GREATER_EQUAL 1930 AND MSVC_VERSION LESS 1940) # Visual Studio 2022 + set(MSVC_TOOLSET_VER 142) + elseif (MSVC_VERSION GREATER_EQUAL 1930 AND MSVC_VERSION LESS 1950) # Visual Studio 2022 set(MSVC_VER 140) + set(MSVC_TOOLSET_VER 143) else (MSVC80) MESSAGE(WARNING "New MSVC_VERSION ${MSVC_VERSION} of MSVC: adapt Copy3rdPartyLibs.cmake") endif (MSVC80) + if (MSVC_TOOLSET_VER AND DEFINED ENV{VCTOOLSREDISTDIR}) + if(ADDRESS_SIZE EQUAL 32) + set(redist_find_path "$ENV{VCTOOLSREDISTDIR}x86\\Microsoft.VC${MSVC_TOOLSET_VER}.CRT") + else(ADDRESS_SIZE EQUAL 32) + set(redist_find_path "$ENV{VCTOOLSREDISTDIR}x64\\Microsoft.VC${MSVC_TOOLSET_VER}.CRT") + endif(ADDRESS_SIZE EQUAL 32) + get_filename_component(redist_path "${redist_find_path}" ABSOLUTE) + MESSAGE(STATUS "VC Runtime redist path: ${redist_path}") + endif (MSVC_TOOLSET_VER AND DEFINED ENV{VCTOOLSREDISTDIR}) + if(ADDRESS_SIZE EQUAL 32) # this folder contains the 32bit DLLs.. (yes really!) set(registry_find_path "[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/SysWOW64") @@ -128,7 +141,14 @@ if(WINDOWS) vcruntime${MSVC_VER}.dll vcruntime${MSVC_VER}_1.dll ) - if(EXISTS "${registry_path}/${release_msvc_file}") + if(redist_path AND EXISTS "${redist_path}/${release_msvc_file}") + MESSAGE(STATUS "Copying redist file from ${redist_path}/${release_msvc_file}") + to_staging_dirs( + ${redist_path} + third_party_targets + ${release_msvc_file}) + elseif(EXISTS "${registry_path}/${release_msvc_file}") + MESSAGE(STATUS "Copying redist file from ${registry_path}/${release_msvc_file}") to_staging_dirs( ${registry_path} third_party_targets -- cgit v1.2.3