diff options
author | Joerg Bornemann <joerg.bornemann@nokia.com> | 2010-08-03 14:32:48 (GMT) |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@nokia.com> | 2010-08-10 08:52:59 (GMT) |
commit | 938c18a341cd653bb93d28fb0aed2f85a97ae943 (patch) | |
tree | 0a88e0b7fe30158ad382631ccf51e1a7ceb31c5b /qmake | |
parent | 56e31f8ad585d8524c0d0d21d5d1f6f821fba3c2 (diff) | |
download | Qt-938c18a341cd653bb93d28fb0aed2f85a97ae943.zip Qt-938c18a341cd653bb93d28fb0aed2f85a97ae943.tar.gz Qt-938c18a341cd653bb93d28fb0aed2f85a97ae943.tar.bz2 |
qmake: remove some old .dsp related code from .vcproj generator
Removal of the following variables:
MSVCPROJ_VERSION, MSVCPROJ_PROJECT, MSVCPROJ_TEMPLATE, MSVCPROJ_CONSOLE,
MSVCPROJ_WINCONDEF, MSVCPROJ_VCPROJTYPE and MSVCPROJ_SUBSYSTEM.
Apart from MSVCPROJ_WINCONDEF none of these variables were in use.
MSVCPROJ_WINCONDEF was used to add the _WINDOWS define if CONFIG
contained "windows". The _CONSOLE define was never added.
Reviewed-by: ossi
Diffstat (limited to 'qmake')
-rw-r--r-- | qmake/generators/win32/msvc_vcproj.cpp | 102 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_vcxproj.cpp | 7 |
2 files changed, 28 insertions, 81 deletions
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index e801371..08d34bf 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -51,7 +51,6 @@ #include <stdlib.h> //#define DEBUG_SOLUTION_GEN -//#define DEBUG_PROJECT_GEN QT_BEGIN_NAMESPACE // Filter GUIDs (Do NOT change these!) ------------------------------ @@ -209,6 +208,7 @@ const char _slnExtSections[] = "\n\tGlobalSection(ExtensibilityGlobals) = pos VcprojGenerator::VcprojGenerator() : Win32MakefileGenerator(), init_flag(false) { } + bool VcprojGenerator::writeMakefile(QTextStream &t) { initProject(); // Fills the whole project with proper data @@ -649,12 +649,12 @@ bool VcprojGenerator::hasBuiltinCompiler(const QString &file) void VcprojGenerator::init() { - if(init_flag) + if (init_flag) return; - if(project->first("TEMPLATE") == "vcsubdirs") { //too much work for subdirs - init_flag = true; + init_flag = true; + + if(project->first("TEMPLATE") == "vcsubdirs") //too much work for subdirs return; - } debug_msg(1, "Generator: MSVC.NET: Initializing variables"); @@ -667,6 +667,20 @@ void VcprojGenerator::init() project->values("QMAKESPEC").append(qgetenv("QMAKESPEC")); processVars(); + + project->values("QMAKE_LIBS") += escapeFilePaths(project->values("LIBS")); + project->values("QMAKE_LIBS_PRIVATE") += escapeFilePaths(project->values("LIBS_PRIVATE")); + + if(!project->values("VERSION").isEmpty()) { + QString version = project->values("VERSION")[0]; + int firstDot = version.indexOf("."); + QString major = version.left(firstDot); + QString minor = version.right(version.length() - firstDot - 1); + minor.replace(QRegExp("\\."), ""); + project->values("QMAKE_LFLAGS").append("/VERSION:" + major + "." + minor); + } + + MakefileGenerator::init(); initOld(); // Currently calling old DSP code to set variables. CLEAN UP! // Figure out what we're trying to build @@ -917,9 +931,10 @@ void VcprojGenerator::initCompilerTool() conf.compiler.parseOptions(project->values("QMAKE_CXXFLAGS")); - // Common for both release and debug - if(project->isActiveConfig("windows")) - conf.compiler.PreprocessorDefinitions += project->values("MSVCPROJ_WINCONDEF"); + if (project->isActiveConfig("windows")) + conf.compiler.PreprocessorDefinitions += "_WINDOWS"; + else if (project->isActiveConfig("console")) + conf.compiler.PreprocessorDefinitions += "_CONSOLE"; conf.compiler.PreprocessorDefinitions += project->values("DEFINES"); conf.compiler.PreprocessorDefinitions += project->values("PRL_EXPORT_DEFINES"); @@ -994,7 +1009,6 @@ void VcprojGenerator::initResourceTool() conf.resource.ResourceOutputFileName = project->first("DESTDIR") + "/$(InputName).res"; } - void VcprojGenerator::initIDLTool() { } @@ -1402,72 +1416,8 @@ void VcprojGenerator::initExtraCompilerOutputs() } } -/* \internal - Sets up all needed variables from the environment and all the different caches and .conf files -*/ - void VcprojGenerator::initOld() { - if(init_flag) - return; - - init_flag = true; - QStringList::Iterator it; - - // Decode version, and add it to $$MSVCPROJ_VERSION -------------- - if(!project->values("VERSION").isEmpty()) { - QString version = project->values("VERSION")[0]; - int firstDot = version.indexOf("."); - QString major = version.left(firstDot); - QString minor = version.right(version.length() - firstDot - 1); - minor.replace(QRegExp("\\."), ""); - project->values("MSVCPROJ_VERSION").append("/VERSION:" + major + "." + minor); - project->values("QMAKE_LFLAGS").append("/VERSION:" + major + "." + minor); - } - - project->values("QMAKE_LIBS") += escapeFilePaths(project->values("LIBS")); - project->values("QMAKE_LIBS_PRIVATE") += escapeFilePaths(project->values("LIBS_PRIVATE")); - - // Get filename w/o extension ----------------------------------- - QString msvcproj_project = ""; - QString targetfilename = ""; - if(!project->isEmpty("TARGET")) { - project->values("TARGET") = unescapeFilePaths(project->values("TARGET")); - targetfilename = msvcproj_project = project->first("TARGET"); - } - - // Init base class too ------------------------------------------- - MakefileGenerator::init(); - - if(msvcproj_project.isEmpty()) - msvcproj_project = Option::output.fileName(); - - msvcproj_project = msvcproj_project.right(msvcproj_project.length() - msvcproj_project.lastIndexOf("\\") - 1); - msvcproj_project = msvcproj_project.left(msvcproj_project.lastIndexOf(".")); - msvcproj_project.replace(QRegExp("-"), ""); - - project->values("MSVCPROJ_PROJECT").append(msvcproj_project); - QStringList &proj = project->values("MSVCPROJ_PROJECT"); - - for(it = proj.begin(); it != proj.end(); ++it) - (*it).replace(QRegExp("\\.[a-zA-Z0-9_]*$"), ""); - - // SUBSYSTEM ----------------------------------------------------- - if(!project->values("QMAKE_APP_FLAG").isEmpty()) { - project->values("MSVCPROJ_TEMPLATE").append("win32app" + project->first("VCPROJ_EXTENSION")); - if(project->isActiveConfig("console")) { - project->values("MSVCPROJ_CONSOLE").append("CONSOLE"); - project->values("MSVCPROJ_WINCONDEF").append("_CONSOLE"); - project->values("MSVCPROJ_VCPROJTYPE").append("0x0103"); - project->values("MSVCPROJ_SUBSYSTEM").append("CONSOLE"); - } else { - project->values("MSVCPROJ_CONSOLE").clear(); - project->values("MSVCPROJ_WINCONDEF").append("_WINDOWS"); - project->values("MSVCPROJ_VCPROJTYPE").append("0x0101"); - project->values("MSVCPROJ_SUBSYSTEM").append("WINDOWS"); - } - } - // $$QMAKE.. -> $$MSVCPROJ.. ------------------------------------- project->values("MSVCPROJ_LIBS") += project->values("QMAKE_LIBS"); project->values("MSVCPROJ_LIBS") += project->values("QMAKE_LIBS_PRIVATE"); @@ -1550,8 +1500,6 @@ QString VcprojGenerator::replaceExtraCompilerVariables(const QString &var, const return ret; } - - bool VcprojGenerator::openOutput(QFile &file, const QString &/*build*/) const { QString outdir; @@ -1603,7 +1551,6 @@ QString VcprojGenerator::findTemplate(QString file) return ret; } - void VcprojGenerator::processPrlVariable(const QString &var, const QStringList &l) { if(var == "QMAKE_PRL_DEFINES") { @@ -1622,9 +1569,8 @@ void VcprojGenerator::outputVariables() #if 0 qDebug("Generator: MSVC.NET: List of current variables:"); for(QMap<QString, QStringList>::ConstIterator it = project->variables().begin(); it != project->variables().end(); ++it) - qDebug("Generator: MSVC.NET: %s => %s", it.key().toLatin1().constData(), it.data().join(" | ").toLatin1().constData()); + qDebug("Generator: MSVC.NET: %s => %s", qPrintable(it.key()), qPrintable(it.value().join(" | "))); #endif } QT_END_NAMESPACE - diff --git a/qmake/generators/win32/msvc_vcxproj.cpp b/qmake/generators/win32/msvc_vcxproj.cpp index d87c0e8..802c596 100644 --- a/qmake/generators/win32/msvc_vcxproj.cpp +++ b/qmake/generators/win32/msvc_vcxproj.cpp @@ -275,9 +275,10 @@ void VcxprojGenerator::initCompilerTool() conf.compiler.parseOptions(project->values("QMAKE_CXXFLAGS")); - // Common for both release and debug - if(project->isActiveConfig("windows")) - conf.compiler.PreprocessorDefinitions += project->values("MSVCPROJ_WINCONDEF"); + if (project->isActiveConfig("windows")) + conf.compiler.PreprocessorDefinitions += "_WINDOWS"; + else if (project->isActiveConfig("console")) + conf.compiler.PreprocessorDefinitions += "_CONSOLE"; conf.compiler.PreprocessorDefinitions += project->values("DEFINES"); conf.compiler.PreprocessorDefinitions += project->values("PRL_EXPORT_DEFINES"); |