From 48ba0389eece8c4bde53b3a615347e0b459839e0 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Mon, 11 Feb 2013 23:44:39 +0100 Subject: [PATCH] qmake: added VCPROJ_ARCH variable. It's a generic way to configure the Visual Studio Solution architecture. It's added to support different project architectures, ARM specifically. It may be a good idea to replace the Win32 and x64 with VCPROJ_ARCH=Win32 and VCPROJ_ARCH=x64 defined in corresponding qmakespecs. Change-Id: I9b23f7393bf248a629c425187d6dd8859092c45c Reviewed-by: Oswald Buddenhagen Reviewed-by: Joerg Bornemann --- qmake/generators/win32/msvc_vcproj.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index c4806f3e8f..9387eb39d4 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -679,7 +679,9 @@ void VcprojGenerator::writeSubDirs(QTextStream &t) } } QString slnConf = _slnSolutionConf; - if (!project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH")) { + if (!project->isEmpty("VCPROJ_ARCH")) { + slnConf.replace(QString("|Win32"), "|" + project->first("VCPROJ_ARCH")); + } else if (!project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH")) { QString slnPlatform = QString("|") + project->values("CE_SDK").join(' ') + " (" + project->first("CE_ARCH") + ")"; slnConf.replace(QString("|Win32"), slnPlatform); } else if (is64Bit) { @@ -694,8 +696,11 @@ void VcprojGenerator::writeSubDirs(QTextStream &t) for(QList::Iterator it = solution_cleanup.begin(); it != solution_cleanup.end(); ++it) { QString platform = is64Bit ? "x64" : "Win32"; QString xplatform = platform; - if (!project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH")) + if (!project->isEmpty("VCPROJ_ARCH")) { + xplatform = project->first("VCPROJ_ARCH").toQString(); + } else if (!project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH")) { xplatform = project->values("CE_SDK").join(' ') + " (" + project->first("CE_ARCH") + ")"; + } if (!project->isHostBuild()) platform = xplatform; t << "\n\t\t" << (*it)->uuid << QString(_slnProjDbgConfTag1).arg(xplatform) << platform; @@ -907,7 +912,9 @@ void VcprojGenerator::initProject() } vcProject.Keyword = project->first("VCPROJ_KEYWORD").toQString(); - if (project->isHostBuild() || project->isEmpty("CE_SDK") || project->isEmpty("CE_ARCH")) { + if (!project->isEmpty("VCPROJ_ARCH")) { + vcProject.PlatformName = project->first("VCPROJ_ARCH").toQString(); + } else if (project->isHostBuild() || project->isEmpty("CE_SDK") || project->isEmpty("CE_ARCH")) { vcProject.PlatformName = (is64Bit ? "x64" : "Win32"); } else { vcProject.PlatformName = project->values("CE_SDK").join(' ') + " (" + project->first("CE_ARCH") + ")"; @@ -978,7 +985,9 @@ void VcprojGenerator::initConfiguration() if (conf.Name.isEmpty()) conf.Name = isDebug ? "Debug" : "Release"; conf.ConfigurationName = conf.Name; - if (project->isHostBuild() || project->isEmpty("CE_SDK") || project->isEmpty("CE_ARCH")) { + if (!project->isEmpty("VCPROJ_ARCH")) { + conf.Name += "|" + project->first("VCPROJ_ARCH"); + } else if (project->isHostBuild() || project->isEmpty("CE_SDK") || project->isEmpty("CE_ARCH")) { conf.Name += (is64Bit ? "|x64" : "|Win32"); } else { conf.Name += "|" + project->values("CE_SDK").join(' ') + " (" + project->first("CE_ARCH") + ")";