diff options
author | Andrew Knight <andrew.knight@digia.com> | 2013-12-26 16:04:29 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-07 10:55:34 +0100 |
commit | 503fd267da497ae9fd5d1a17d5bbfd314b4311d7 (patch) | |
tree | 26e7a579bde7c80218e9612d1799ad8c30c62f81 /qmake | |
parent | a90972e8f88dbe6bd43a15559e12c26ec9ba646d (diff) | |
download | qtbase-503fd267da497ae9fd5d1a17d5bbfd314b4311d7.tar.gz |
qmake vcproj generator: Honor the preferred MSVC version in the mkspec
Some cross-compiling mkspecs may require a different MSVC version than
the one found in the path (or the default version). This change allows
the preferred MSVC version to be selected from the mkspec's MSVC_VER
variable when found.
Task-number: QTBUG-35328
Change-Id: I19e03101e3921dfd5026421aef4630e11b9f131e
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'qmake')
-rw-r--r-- | qmake/generators/win32/msvc_vcproj.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 5f2486319c..4cd93e60cb 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -111,9 +111,10 @@ QT_END_NAMESPACE #endif QT_BEGIN_NAMESPACE -DotNET which_dotnet_version() +DotNET which_dotnet_version(const QByteArray &preferredVersion = QByteArray()) { #ifndef Q_OS_WIN32 + Q_UNUSED(preferredVersion); return NET2002; // Always generate 7.0 versions on other platforms #else // Only search for the version once @@ -135,6 +136,10 @@ DotNET which_dotnet_version() installPaths.insert(lowestInstalledVersion->version, path); ++installed; current_version = lowestInstalledVersion->version; + if (QByteArray(lowestInstalledVersion->versionStr).contains(preferredVersion)) { + installed = 1; + break; + } } } @@ -583,7 +588,7 @@ void VcprojGenerator::writeSubDirs(QTextStream &t) return; } - switch(which_dotnet_version()) { + switch (which_dotnet_version(project->first("MSVC_VER").toLatin1())) { case NET2013: t << _slnHeader120; break; @@ -872,7 +877,7 @@ void VcprojGenerator::initProject() // Own elements ----------------------------- vcProject.Name = unescapeFilePath(project->first("QMAKE_ORIG_TARGET").toQString()); - switch(which_dotnet_version()) { + switch (which_dotnet_version(project->first("MSVC_VER").toLatin1())) { case NET2013: vcProject.Version = "13.00"; break; @@ -922,7 +927,7 @@ void VcprojGenerator::initConfiguration() // - Do this first since main configuration elements may need // - to know of certain compiler/linker options VCConfiguration &conf = vcProject.Configuration; - conf.CompilerVersion = which_dotnet_version(); + conf.CompilerVersion = which_dotnet_version(project->first("MSVC_VER").toLatin1()); initCompilerTool(); |