From f9ad1f5844af1e42c8de3cf10f6a9597924d9f9e Mon Sep 17 00:00:00 2001 From: Ivan Komissarov Date: Sat, 17 Apr 2021 21:23:44 +0300 Subject: Allow to specify windowsSdkVersion Previously, it was not possible to use older windows SDK version. Fix that by introducing the new property that is passed to vcvarsall.bat Task-number: QBS-1498 Change-Id: Ic526eabb8ff82ddd85c93e90fd20421595a121f4 Reviewed-by: Christian Kandeler --- src/lib/corelib/tools/vsenvironmentdetector.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/lib/corelib/tools/vsenvironmentdetector.cpp') diff --git a/src/lib/corelib/tools/vsenvironmentdetector.cpp b/src/lib/corelib/tools/vsenvironmentdetector.cpp index b0788823f..a11934d52 100644 --- a/src/lib/corelib/tools/vsenvironmentdetector.cpp +++ b/src/lib/corelib/tools/vsenvironmentdetector.cpp @@ -241,8 +241,10 @@ void VsEnvironmentDetector::writeBatchFile(QIODevice *device, const QString &vcv << "setlocal" << endl; batClearVars(s, varnames); s << "set PATH=" << m_windowsSystemDirPath << endl; // vcvarsall.bat needs tools from here - s << "call \"" << vcvarsallbat << "\" " << vcArchitecture(msvc) - << " || exit /b 1" << endl; + s << "call \"" << vcvarsallbat << "\" " << vcArchitecture(msvc); + if (!msvc->sdkVersion.isEmpty()) + s << " " << msvc->sdkVersion; + s << " || exit /b 1" << endl; batPrintVars(s, varnames); s << "endlocal" << endl; } -- cgit v1.2.3 From 2f34e637828f7e519a25a498bd5aa4e8f955217d Mon Sep 17 00:00:00 2001 From: Ivan Komissarov Date: Tue, 20 Apr 2021 22:25:49 +0300 Subject: msvc: Pass -vcvars_ver to vcvarsall.bat when detecting environment This is required to properly support multiple MSVC toolchains (also now supported). Fixes: QBS-1498 Change-Id: I1274379496d47ebf7842eaed05f498b7af111b5b Reviewed-by: Christian Kandeler --- src/lib/corelib/tools/vsenvironmentdetector.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/lib/corelib/tools/vsenvironmentdetector.cpp') diff --git a/src/lib/corelib/tools/vsenvironmentdetector.cpp b/src/lib/corelib/tools/vsenvironmentdetector.cpp index a11934d52..82dff578f 100644 --- a/src/lib/corelib/tools/vsenvironmentdetector.cpp +++ b/src/lib/corelib/tools/vsenvironmentdetector.cpp @@ -244,6 +244,9 @@ void VsEnvironmentDetector::writeBatchFile(QIODevice *device, const QString &vcv s << "call \"" << vcvarsallbat << "\" " << vcArchitecture(msvc); if (!msvc->sdkVersion.isEmpty()) s << " " << msvc->sdkVersion; + const auto vcVarsVer = MSVC::vcVariablesVersionFromBinPath(msvc->binPath); + if (!vcVarsVer.isEmpty()) + s << " -vcvars_ver=" << vcVarsVer; s << " || exit /b 1" << endl; batPrintVars(s, varnames); s << "endlocal" << endl; -- cgit v1.2.3