devops: be compatible with multiple MSVS installations (#16121)

This commit is contained in:
Max Schmitt 2022-08-01 23:37:07 +02:00 committed by GitHub
parent 7a18def019
commit 99cc3869d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -75,7 +75,7 @@ elif is_win; then
echo "ac_add_options --target=x86_64-pc-mingw32" >> .mozconfig echo "ac_add_options --target=x86_64-pc-mingw32" >> .mozconfig
echo "ac_add_options --host=x86_64-pc-mingw32" >> .mozconfig echo "ac_add_options --host=x86_64-pc-mingw32" >> .mozconfig
DLL_FILE=$("C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -find '**\Redist\MSVC\*\x64\**\vcruntime140.dll') DLL_FILE=$("C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -find '**\Redist\MSVC\*\x64\**\vcruntime140.dll')
WIN32_REDIST_DIR=$(dirname "$DLL_FILE") WIN32_REDIST_DIR=$(dirname "$DLL_FILE" | tail -n 1)
if ! [[ -d $WIN32_REDIST_DIR ]]; then if ! [[ -d $WIN32_REDIST_DIR ]]; then
echo "ERROR: cannot find MS VS C++ redistributable $WIN32_REDIST_DIR" echo "ERROR: cannot find MS VS C++ redistributable $WIN32_REDIST_DIR"
exit 1; exit 1;

View File

@ -68,7 +68,7 @@ elif is_win; then
echo "ac_add_options --target=x86_64-pc-mingw32" >> .mozconfig echo "ac_add_options --target=x86_64-pc-mingw32" >> .mozconfig
echo "ac_add_options --host=x86_64-pc-mingw32" >> .mozconfig echo "ac_add_options --host=x86_64-pc-mingw32" >> .mozconfig
DLL_FILE=$("C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -find '**\Redist\MSVC\*\x64\**\vcruntime140.dll') DLL_FILE=$("C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -find '**\Redist\MSVC\*\x64\**\vcruntime140.dll')
WIN32_REDIST_DIR=$(dirname "$DLL_FILE") WIN32_REDIST_DIR=$(dirname "$DLL_FILE" | tail -n 1)
if ! [[ -d $WIN32_REDIST_DIR ]]; then if ! [[ -d $WIN32_REDIST_DIR ]]; then
echo "ERROR: cannot find MS VS C++ redistributable $WIN32_REDIST_DIR" echo "ERROR: cannot find MS VS C++ redistributable $WIN32_REDIST_DIR"
exit 1; exit 1;

View File

@ -35,7 +35,7 @@ function selectXcodeVersionOrDie() {
# see https://docs.microsoft.com/en-us/visualstudio/install/tools-for-managing-visual-studio-instances?view=vs-2019 # see https://docs.microsoft.com/en-us/visualstudio/install/tools-for-managing-visual-studio-instances?view=vs-2019
function printMSVCRedistDir() { function printMSVCRedistDir() {
local dll_file=$("C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -find '**\Redist\MSVC\*\x64\**\vcruntime140.dll') local dll_file=$("C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -find '**\Redist\MSVC\*\x64\**\vcruntime140.dll')
local redist_dir=$(dirname "$dll_file") local redist_dir=$(dirname "$dll_file" | tail -n 1)
if ! [[ -d $redist_dir ]]; then if ! [[ -d $redist_dir ]]; then
echo "ERROR: cannot find MS VS C++ redistributable $redist_dir" echo "ERROR: cannot find MS VS C++ redistributable $redist_dir"
exit 1; exit 1;