mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 21:49:55 +00:00
Merge branch 'robuster-vswhere' into 'master'
Ensure vswhere finds us a single suitable MSVC installation See merge request OpenMW/openmw!668
This commit is contained in:
commit
9c1bda5408
1 changed files with 7 additions and 1 deletions
|
@ -1067,7 +1067,13 @@ if [ -n "$ACTIVATE_MSVC" ]; then
|
|||
echo -n "- Activating MSVC in the current shell... "
|
||||
command -v vswhere >/dev/null 2>&1 || { echo "Error: vswhere is not on the path."; wrappedExit 1; }
|
||||
|
||||
MSVC_INSTALLATION_PATH=$(vswhere -products '*' -version "[$MSVC_REAL_VER,$(awk "BEGIN { print $MSVC_REAL_VER + 1; exit }"))" -property installationPath)
|
||||
# There are so many arguments now that I'm going to document them:
|
||||
# * products: allow Visual Studio or standalone build tools
|
||||
# * version: obvious. Awk helps make a version range by adding one.
|
||||
# * property installationPath: only give the installation path.
|
||||
# * latest: return only one result if several candidates exist. Prefer the last installed/updated
|
||||
# * requires: make sure it's got the MSVC compiler instead of, for example, just the .NET compiler. The .x86.x64 suffix means it's for either, not that it's the x64 on x86 cross compiler as you always get both
|
||||
MSVC_INSTALLATION_PATH=$(vswhere -products '*' -version "[$MSVC_REAL_VER,$(awk "BEGIN { print $MSVC_REAL_VER + 1; exit }"))" -property installationPath -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64)
|
||||
if [ -z "$MSVC_INSTALLATION_PATH" ]; then
|
||||
echo "vswhere was unable to find MSVC $MSVC_DISPLAY_YEAR"
|
||||
wrappedExit 1
|
||||
|
|
Loading…
Reference in a new issue