Only try -prerelease as a fallback

Desktop / LibreOffice - Stephan Bergmann [redhat.com] - 10 November 2021 16:11 UTC

Otherwise, --with-visual-studio=2022 picked the Preview version for me when I have both Preview and Current installed.

Change-Id: I1c53a28877a6de80db54ed9b17b1eee0eae923c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124963

###

diff --git a/configure.ac b/configure.ac
index a894323e2881..336c79925427 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3887,7 +3887,10 @@ find_msvc()
PathFormat "$vswhere"
vswhere=$formatted_path_unix
for ver in $vsversions; do
- vswhereoutput=`$vswhere -prerelease -version "@<:@ $ver , $(expr $ver + 1) @:}@" -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath | head -1`
+ vswhereoutput=`$vswhere -version "@<:@ $ver , $(expr $ver + 1) @:}@" -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath | head -1`
+ if test -z "$vswhereoutput"; then
+ vswhereoutput=`$vswhere -prerelease -version "@<:@ $ver , $(expr $ver + 1) @:}@" -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath | head -1`
+ fi
# Fall back to all MS products (this includes VC++ Build Tools)
if ! test -n "$vswhereoutput"; then
AC_MSG_CHECKING([VC++ Build Tools and similar])

0aea45001b73 Only try -prerelease as a fallback
configure.ac | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

Upstream: cgit.freedesktop.org


  • Share