From b58c6bfe14d86a2094c240c24c37a6bb3fa62726 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Wed, 23 Feb 2011 17:08:47 +0100 Subject: Split monolithic qlocale.cpp into platform-specific files This is just a refactoring change to split huge unreadable qlocale.cpp into multiple files. Reviewed-by: Zeno Albisser --- qmake/Makefile.unix | 14 ++++++++++++-- qmake/Makefile.win32 | 2 ++ qmake/Makefile.win32-g++ | 8 ++++++++ qmake/Makefile.win32-g++-sh | 8 ++++++++ 4 files changed, 30 insertions(+), 2 deletions(-) (limited to 'qmake') diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix index a24076e610..5ac9c8c9f3 100644 --- a/qmake/Makefile.unix +++ b/qmake/Makefile.unix @@ -21,7 +21,8 @@ QOBJS=qtextcodec.o qutfcodec.o qstring.o qtextstream.o qiodevice.o qmalloc.o qgl qfsfileengine_iterator.o qregexp.o qvector.o qbitarray.o qdir.o qdiriterator.o quuid.o qhash.o \ qfileinfo.o qdatetime.o qstringlist.o qabstractfileengine.o qtemporaryfile.o \ qmap.o qmetatype.o qsettings.o qsystemerror.o qlibraryinfo.o qvariant.o qvsnprintf.o \ - qlocale.o qlinkedlist.o qurl.o qnumeric.o qcryptographichash.o qxmlstream.o qxmlutils.o \ + qlocale.o qlocale_tools.o qlocale_unix.o qlinkedlist.o qurl.o qnumeric.o qcryptographichash.o \ + qxmlstream.o qxmlutils.o \ $(QTOBJS) @@ -57,7 +58,10 @@ DEPEND_SRC=project.cpp property.cpp meta.cpp main.cpp generators/makefile.cpp ge $(SOURCE_PATH)/src/corelib/io/qfileinfo.cpp $(SOURCE_PATH)/src/corelib/tools/qdatetime.cpp \ $(SOURCE_PATH)/src/corelib/tools/qstringlist.cpp $(SOURCE_PATH)/src/corelib/tools/qmap.cpp \ $(SOURCE_PATH)/src/corelib/global/qconfig.cpp $(SOURCE_PATH)/src/corelib/io/qurl.cpp \ - $(SOURCE_PATH)/src/corelib/tools/qlocale.cpp $(SOURCE_PATH)/src/corelib/tools/qlinkedlist.cpp \ + $(SOURCE_PATH)/src/corelib/tools/qlocale.cpp \ + $(SOURCE_PATH)/src/corelib/tools/qlocale_tools.cpp \ + $(SOURCE_PATH)/src/corelib/tools/qlocale_unix.cpp \ + $(SOURCE_PATH)/src/corelib/tools/qlinkedlist.cpp \ $(SOURCE_PATH)/src/corelib/tools/qhash.cpp $(SOURCE_PATH)/src/corelib/kernel/qcore_mac.cpp \ $(SOURCE_PATH)/src/corelib/io/qtemporaryfile.cpp $(SOURCE_PATH)/src/corelib/kernel/qmetatype.cpp \ $(SOURCE_PATH)/src/corelib/io/qsettings.cpp $(SOURCE_PATH)/src/corelib/kernel/qvariant.cpp \ @@ -156,6 +160,12 @@ qstring.o: $(SOURCE_PATH)/src/corelib/tools/qstring.cpp qlocale.o: $(SOURCE_PATH)/src/corelib/tools/qlocale.cpp $(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qlocale.cpp +qlocale_tools.o: $(SOURCE_PATH)/src/corelib/tools/qlocale_tools.cpp + $(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qlocale_tools.cpp + +qlocale_unix.o: $(SOURCE_PATH)/src/corelib/tools/qlocale_unix.cpp + $(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qlocale_unix.cpp + qdatastream.o: $(SOURCE_PATH)/src/corelib/io/qdatastream.cpp $(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qdatastream.cpp diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32 index 4d2953743d..0791eb4baf 100644 --- a/qmake/Makefile.win32 +++ b/qmake/Makefile.win32 @@ -97,6 +97,8 @@ QTOBJS= \ qlist.obj \ qlinkedlist.obj \ qlocale.obj \ + qlocale_tools.obj \ + qlocale_win.obj \ qmalloc.obj \ qmap.obj \ qregexp.obj \ diff --git a/qmake/Makefile.win32-g++ b/qmake/Makefile.win32-g++ index 59ac8c25c5..ee194f66d2 100644 --- a/qmake/Makefile.win32-g++ +++ b/qmake/Makefile.win32-g++ @@ -75,6 +75,8 @@ QTOBJS= \ qlist.o \ qlinkedlist.o \ qlocale.o \ + qlocale_tools.o \ + qlocale_win.o \ qmalloc.o \ qmap.o \ qregexp.o \ @@ -176,6 +178,12 @@ qstring.o: $(SOURCE_PATH)/src/corelib/tools/qstring.cpp qlocale.o: $(SOURCE_PATH)/src/corelib/tools/qlocale.cpp $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qlocale.cpp +qlocale_tools.o: $(SOURCE_PATH)/src/corelib/tools/qlocale_tools.cpp + $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qlocale_tools.cpp + +qlocale_win.o: $(SOURCE_PATH)/src/corelib/tools/qlocale_win.cpp + $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qlocale_win.cpp + quuid.o: $(SOURCE_PATH)/src/corelib/plugin/quuid.cpp $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/plugin/quuid.cpp diff --git a/qmake/Makefile.win32-g++-sh b/qmake/Makefile.win32-g++-sh index a84b3f6f16..52ad7a27cb 100644 --- a/qmake/Makefile.win32-g++-sh +++ b/qmake/Makefile.win32-g++-sh @@ -75,6 +75,8 @@ QTOBJS= \ qlist.o \ qlinkedlist.o \ qlocale.o \ + qlocale_tools.o \ + qlocale_win.o \ qmalloc.o \ qmap.o \ qregexp.o \ @@ -175,6 +177,12 @@ qstring.o: $(SOURCE_PATH)/src/corelib/tools/qstring.cpp qlocale.o: $(SOURCE_PATH)/src/corelib/tools/qlocale.cpp $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qlocale.cpp +qlocale_tools.o: $(SOURCE_PATH)/src/corelib/tools/qlocale_tools.cpp + $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qlocale_tools.cpp + +qlocale_win.o: $(SOURCE_PATH)/src/corelib/tools/qlocale_win.cpp + $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qlocale_win.cpp + quuid.o: $(SOURCE_PATH)/src/corelib/plugin/quuid.cpp $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/plugin/quuid.cpp -- cgit v1.2.1 From 498d14367250589e803d32155ffdd4c6fb56c764 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 10 Mar 2011 16:18:18 +0200 Subject: Strip echo suppression character "@" from commands in symbian-sbsv2 Symbian-sbsv2 toolchain cannot handle echo suppresion character "@" in recipes, so the character is stripped from all commands if it exists at the beginning of the command. Task-number: QTBUG-4767 Reviewed-by: Iain --- qmake/generators/symbian/symmake_sbsv2.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'qmake') diff --git a/qmake/generators/symbian/symmake_sbsv2.cpp b/qmake/generators/symbian/symmake_sbsv2.cpp index f94a63f06f..6f532886a4 100644 --- a/qmake/generators/symbian/symmake_sbsv2.cpp +++ b/qmake/generators/symbian/symmake_sbsv2.cpp @@ -84,6 +84,12 @@ static void fixFlmCmd(QString *cmdLine, const QMap &commandsTo // separator, so replace it with "&&" command concatenator. cmdLine->replace("\n\t", "&&"); + // Strip output suppression, as sbsv2 can't handle it in FLMs. Cannot be done by simply + // adding "@" to commandsToReplace, as it'd get handled last due to alphabetical ordering, + // potentially masking other commands that need replacing. + if (cmdLine->contains("@")) + cmdLine->replace(QRegExp(cmdFind.arg("@")), cmdReplace.arg("")); + // Iterate command replacements in reverse alphabetical order of keys so // that keys which are starts of other longer keys are iterated after longer keys. QMapIterator cmdIter(commandsToReplace); -- cgit v1.2.1 From 8731cb8b852eaa638a64c8a6301ba577f2b735ac Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 15 Mar 2011 12:02:20 +0200 Subject: Removed broken "deploy.path" support from Symbian The undocumented special "deploy.path" variable hasn't been working in Symbian for several releases and doesn't really make much sense in Symbian in the first place. Also, apparently no-one has ever used it as there has been no bug reports, so might as well remove the check for it in Symbian. Task-number: QTBUG-14426 Reviewed-by: Janne Koskinen --- qmake/generators/symbian/initprojectdeploy_symbian.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'qmake') diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.cpp b/qmake/generators/symbian/initprojectdeploy_symbian.cpp index f9fae9d799..f70c49deef 100644 --- a/qmake/generators/symbian/initprojectdeploy_symbian.cpp +++ b/qmake/generators/symbian/initprojectdeploy_symbian.cpp @@ -169,9 +169,7 @@ void initProjectDeploySymbian(QMakeProject* project, QStringList& generatedDirs, QStringList& generatedFiles) { - QString targetPath = project->values("deploy.path").join(" "); - if (targetPath.isEmpty()) - targetPath = testPath; + QString targetPath = testPath; if (targetPath.endsWith("/") || targetPath.endsWith("\\")) targetPath = targetPath.mid(0, targetPath.size() - 1); -- cgit v1.2.1 From 3dd9e6a40bc4131ebc35d367af69fd9197e19344 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 15 Mar 2011 14:42:03 +0100 Subject: Option::fixString: Avoid double hash lookups for cache hits. Reviewed-by: Oswald Buddenhagen --- qmake/option.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'qmake') diff --git a/qmake/option.cpp b/qmake/option.cpp index fcbf5face0..28b764a8cc 100644 --- a/qmake/option.cpp +++ b/qmake/option.cpp @@ -624,10 +624,12 @@ Option::fixString(QString string, uchar flags) qmakeAddCacheClear(qmakeDeleteCacheClear >, (void**)&cache); } FixStringCacheKey cacheKey(string, flags); - if(cache->contains(cacheKey)) { - const QString ret = cache->value(cacheKey); - //qDebug() << "Fix (cached) " << orig_string << "->" << ret; - return ret; + + QHash::const_iterator it = cache->constFind(cacheKey); + + if (it != cache->constEnd()) { + //qDebug() << "Fix (cached) " << orig_string << "->" << it.value(); + return it.value(); } //fix the environment variables -- cgit v1.2.1 From 32d872a3456ecd7cb8c0f0437a7301e1c476bbd3 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 15 Mar 2011 14:45:21 +0100 Subject: Option::fixString: Don't recreate same QRegExp on each function call. Reviewed-by: Oswald Buddenhagen --- qmake/option.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qmake') diff --git a/qmake/option.cpp b/qmake/option.cpp index 28b764a8cc..7bee6592ff 100644 --- a/qmake/option.cpp +++ b/qmake/option.cpp @@ -635,7 +635,7 @@ Option::fixString(QString string, uchar flags) //fix the environment variables if(flags & Option::FixEnvVars) { int rep; - QRegExp reg_var("\\$\\(.*\\)"); + static QRegExp reg_var("\\$\\(.*\\)"); reg_var.setMinimal(true); while((rep = reg_var.indexIn(string)) != -1) string.replace(rep, reg_var.matchedLength(), -- cgit v1.2.1 From 3a2bb048b49e8d009d785ddd4c0ed221766cc11e Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 15 Mar 2011 14:20:03 +0100 Subject: Don't cache resolved paths in MakefileGenerator::fileFixify(). The cache ends up dog-slow because of poor distribution in hashing of QStrings, and even with a better hashing function, computing the result on the fly is still faster. Tested with WebCore.pro, on Linux processing time goes from 58 to 8 seconds, and on Windows from 105 to 65 seconds. Reviewed-by: Marius Storm-Olsen --- qmake/cachekeys.h | 48 ------------------------------------------- qmake/generators/makefile.cpp | 12 ----------- 2 files changed, 60 deletions(-) (limited to 'qmake') diff --git a/qmake/cachekeys.h b/qmake/cachekeys.h index 2957d617e9..b29e4f211f 100644 --- a/qmake/cachekeys.h +++ b/qmake/cachekeys.h @@ -118,54 +118,6 @@ struct FileInfoCacheKey inline uint qHash(const FileInfoCacheKey &f) { return f.hashCode(); } // ------------------------------------------------------------------------------------------------- -struct FileFixifyCacheKey -{ - mutable uint hash; - QString in_d, out_d; - QString file, pwd; - uint fixType; - bool canonicalize; - FileFixifyCacheKey(const QString &f, const QString &od, const QString &id, - uint ft, bool c) - { - hash = 0; - pwd = qmake_getpwd(); - file = f; - if(od.isNull()) - out_d = Option::output_dir; - else - out_d = od; - if(id.isNull()) - in_d = qmake_getpwd(); - else - in_d = id; - fixType = ft; - canonicalize = c; - } - QString toString() const { - return file + "--" + in_d + "--" + out_d + "--" + pwd + "--" + - QString::number(fixType) + "--" + QString::number((int)canonicalize); - } - bool operator==(const FileFixifyCacheKey &f) const - { - return (f.canonicalize == canonicalize && - f.fixType == fixType && - f.file == file && - f.in_d == in_d && - f.out_d == out_d && - f.pwd == pwd); - } - inline uint hashCode() const { - if(!hash) - hash = uint(canonicalize) | uint(fixType) | - qHash(file) | qHash(in_d) | qHash(out_d) /*|qHash(pwd)*/; - return hash; - } -}; - -inline uint qHash(const FileFixifyCacheKey &f) { return f.hashCode(); } -// ------------------------------------------------------------------------------------------------- - template inline void qmakeDeleteCacheClear(void *i) { delete reinterpret_cast(i); } diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 595768f4a3..796397663b 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -2813,17 +2813,6 @@ MakefileGenerator::fileFixify(const QString& file, const QString &out_d, const Q return file; QString ret = unescapeFilePath(file); - //setup the cache - static QHash *cache = 0; - if(!cache) { - cache = new QHash; - qmakeAddCacheClear(qmakeDeleteCacheClear >, (void**)&cache); - } - FileFixifyCacheKey cacheKey(ret, out_d, in_d, fix, canon); - QString cacheVal = cache->value(cacheKey); - if(!cacheVal.isNull()) - return cacheVal; - //do the fixin' QString pwd = qmake_getpwd(); if (!pwd.endsWith('/')) @@ -2908,7 +2897,6 @@ MakefileGenerator::fileFixify(const QString& file, const QString &out_d, const Q debug_msg(3, "Fixed[%d,%d] %s :: to :: %s [%s::%s] [%s::%s]", fix, canon, orig_file.toLatin1().constData(), ret.toLatin1().constData(), in_d.toLatin1().constData(), out_d.toLatin1().constData(), pwd.toLatin1().constData(), Option::output_dir.toLatin1().constData()); - cache->insert(cacheKey, ret); return ret; } -- cgit v1.2.1 From 1163032eda2dce89bd464d2a99f3cbbcf20cc232 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 16 Mar 2011 15:49:53 +0200 Subject: Fix emulator deployment for items with "!:" drive. "!:" drive is used to indicate need to prompt user to specify installation drive, which is obviously not happening when we do the build time emulator deployment, so default it to "c:" drive. Task-number: QTBUG-18134 Reviewed-by: Janne Koskinen --- qmake/generators/symbian/initprojectdeploy_symbian.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'qmake') diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.cpp b/qmake/generators/symbian/initprojectdeploy_symbian.cpp index f70c49deef..8d04a424c6 100644 --- a/qmake/generators/symbian/initprojectdeploy_symbian.cpp +++ b/qmake/generators/symbian/initprojectdeploy_symbian.cpp @@ -223,7 +223,10 @@ void initProjectDeploySymbian(QMakeProject* project, } else { if (0 == platform.compare(QLatin1String(EMULATOR_DEPLOYMENT_PLATFORM))) { if (devicePathHasDriveLetter) { - devicePath = qt_epocRoot() + "epoc32/winscw/" + devicePath.remove(1, 1); + if (devicePath.startsWith("!")) + devicePath = qt_epocRoot() + "epoc32/winscw/c" + devicePath.remove(0, 2); + else + devicePath = qt_epocRoot() + "epoc32/winscw/" + devicePath.remove(1, 1); } else { devicePath = qt_epocRoot() + "epoc32/winscw/c" + devicePath; } -- cgit v1.2.1 From 7627d9d5316430e01a7ecb1d20d3a56b4b4c740a Mon Sep 17 00:00:00 2001 From: Martin Petersson Date: Tue, 22 Mar 2011 17:36:29 +0100 Subject: qmake vcxproj generator: fix non flat projects for VS2010 The filters for files in the non flat projects will start with the base filter name and then the path to the file. So the detection of the filter needs to be done by the start of the filter namse so that we correctly add the compile commands for the added files. Task-number: QTBUG-13928 Reviewed-by: Joerg Bornemann --- qmake/generators/win32/msbuild_objectmodel.cpp | 34 +++++++++++++------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'qmake') diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp index 9fd5fa967f..d4d2400146 100644 --- a/qmake/generators/win32/msbuild_objectmodel.cpp +++ b/qmake/generators/win32/msbuild_objectmodel.cpp @@ -1670,21 +1670,21 @@ void VCXProjectWriter::outputFileConfigs(VCProject &project, XmlOutput &xml, Xml for (int i = 0; i < project.SingleProjects.count(); ++i) { VCFilter filter; const VCProjectSingleConfig &singleCfg = project.SingleProjects.at(i); - if (filtername == "Root Files") { + if (filtername.startsWith("Root Files")) { filter = singleCfg.RootFiles; - } else if (filtername == "Source Files") { + } else if (filtername.startsWith("Source Files")) { filter = singleCfg.SourceFiles; - } else if (filtername == "Header Files") { + } else if (filtername.startsWith("Header Files")) { filter = singleCfg.HeaderFiles; - } else if (filtername == "Generated Files") { + } else if (filtername.startsWith("Generated Files")) { filter = singleCfg.GeneratedFiles; - } else if (filtername == "LexYacc Files") { + } else if (filtername.startsWith("LexYacc Files")) { filter = singleCfg.LexYaccFiles; - } else if (filtername == "Translation Files") { + } else if (filtername.startsWith("Translation Files")) { filter = singleCfg.TranslationFiles; - } else if (filtername == "Form Files") { + } else if (filtername.startsWith("Form Files")) { filter = singleCfg.FormFiles; - } else if (filtername == "Resource Files") { + } else if (filtername.startsWith("Resource Files")) { filter = singleCfg.ResourceFiles; } else { // ExtraCompilers @@ -1698,7 +1698,7 @@ void VCXProjectWriter::outputFileConfigs(VCProject &project, XmlOutput &xml, Xml if ( !fileAdded ) { - if (filtername == "Source Files") { + if (filtername.startsWith("Source Files")) { xmlFilter << tag("ClCompile") << attrTag("Include",Option::fixPathToLocalOS(info.file)) @@ -1707,7 +1707,7 @@ void VCXProjectWriter::outputFileConfigs(VCProject &project, XmlOutput &xml, Xml xml << tag("ClCompile") << attrTag("Include",Option::fixPathToLocalOS(info.file)); - } else if(filtername == "Header Files") { + } else if(filtername.startsWith("Header Files")) { xmlFilter << tag("ClInclude") << attrTag("Include",Option::fixPathToLocalOS(info.file)) @@ -1715,7 +1715,7 @@ void VCXProjectWriter::outputFileConfigs(VCProject &project, XmlOutput &xml, Xml xml << tag("ClInclude") << attrTag("Include",Option::fixPathToLocalOS(info.file)); - } else if(filtername == "Generated Files" || filtername == "Form Files") { + } else if(filtername.startsWith("Generated Files") || filtername.startsWith("Form Files")) { if (info.file.endsWith(".h")) { @@ -1751,7 +1751,7 @@ void VCXProjectWriter::outputFileConfigs(VCProject &project, XmlOutput &xml, Xml << attrTag("Include",Option::fixPathToLocalOS(info.file)); } - } else if(filtername == "Root Files") { + } else if(filtername.startsWith("Root Files")) { if (info.file.endsWith(".rc")) { @@ -1831,7 +1831,7 @@ bool VCXProjectWriter::outputFileConfig(VCFilter &filter, XmlOutput &xml, XmlOut xml << tag("CustomBuild") << attrTag("Include",Option::fixPathToLocalOS(filename)); - if ( filtername == "Form Files" || filtername == "Generated Files" || filtername == "Resource Files" ) + if ( filtername.startsWith("Form Files") || filtername.startsWith("Generated Files") || filtername.startsWith("Resource Files") ) xml << attrTagS("FileType", "Document"); } @@ -1842,7 +1842,7 @@ bool VCXProjectWriter::outputFileConfig(VCFilter &filter, XmlOutput &xml, XmlOut { fileAdded = true; - if (filtername == "Source Files") { + if (filtername.startsWith("Source Files")) { xmlFilter << tag("ClCompile") << attrTag("Include",Option::fixPathToLocalOS(filename)) @@ -1851,7 +1851,7 @@ bool VCXProjectWriter::outputFileConfig(VCFilter &filter, XmlOutput &xml, XmlOut xml << tag("ClCompile") << attrTag("Include",Option::fixPathToLocalOS(filename)); - } else if(filtername == "Header Files") { + } else if(filtername.startsWith("Header Files")) { xmlFilter << tag("ClInclude") << attrTag("Include",Option::fixPathToLocalOS(filename)) @@ -1859,7 +1859,7 @@ bool VCXProjectWriter::outputFileConfig(VCFilter &filter, XmlOutput &xml, XmlOut xml << tag("ClInclude") << attrTag("Include",Option::fixPathToLocalOS(filename)); - } else if(filtername == "Generated Files" || filtername == "Form Files") { + } else if(filtername.startsWith("Generated Files") || filtername.startsWith("Form Files")) { if (filename.endsWith(".h")) { @@ -1894,7 +1894,7 @@ bool VCXProjectWriter::outputFileConfig(VCFilter &filter, XmlOutput &xml, XmlOut xml << tag("CustomBuild") << attrTag("Include",Option::fixPathToLocalOS(filename)); } - } else if(filtername == "Root Files") { + } else if(filtername.startsWith("Root Files")) { if (filename.endsWith(".rc")) { -- cgit v1.2.1 From b10199ab328848e954c3701f745043ff697a2c27 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 22 Mar 2011 16:22:34 +0100 Subject: ReplaceExtraCompilerCacheKey: Don't recreate "::" QString on each call. Reviewed-by: Marius Storm-Olsen --- qmake/generators/makefile.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'qmake') diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 796397663b..9e2be310c6 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -1485,18 +1485,20 @@ MakefileGenerator::createObjectList(const QStringList &sources) ReplaceExtraCompilerCacheKey::ReplaceExtraCompilerCacheKey(const QString &v, const QStringList &i, const QStringList &o) { + static QString doubleColon = QLatin1String("::"); + hash = 0; pwd = qmake_getpwd(); var = v; { QStringList il = i; il.sort(); - in = il.join("::"); + in = il.join(doubleColon); } { QStringList ol = o; ol.sort(); - out = ol.join("::"); + out = ol.join(doubleColon); } } -- cgit v1.2.1 From a6d48ca57403539ab8e00d16f80bd4cd334e1b5c Mon Sep 17 00:00:00 2001 From: Jonathan Liu Date: Mon, 4 Apr 2011 13:01:48 +0200 Subject: win32-g++: Correct the order of linked Windows libraries On Windows 7, kernel32.dll exports many of the same functions as advapi32.dll. If executables link to these functions in kernel32.dll instead of advapi32.dll, running these executables on older versions of Windows will cause an entry point error. This would occur due to kernel32 being specified before advapi32. To resolve this issue, advapi32 is specified before kernel32 when linking. Task-number: QTBUG-18537 Merge-request: 1169 Reviewed-by: Oswald Buddenhagen --- qmake/Makefile.win32-g++ | 2 +- qmake/Makefile.win32-g++-sh | 2 +- qmake/qmake.pri | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'qmake') diff --git a/qmake/Makefile.win32-g++ b/qmake/Makefile.win32-g++ index 29fbd0af7a..5a46e4138a 100644 --- a/qmake/Makefile.win32-g++ +++ b/qmake/Makefile.win32-g++ @@ -28,7 +28,7 @@ CFLAGS = -c -o$@ -O \ -DQT_BOOTSTRAPPED -DQLIBRARYINFO_EPOCROOT CXXFLAGS = $(CFLAGS) LFLAGS = -static-libgcc -static-libstdc++ -s -LIBS = -lole32 -luuid +LIBS = -lole32 -luuid -ladvapi32 -lkernel32 LINKQMAKE = g++ $(LFLAGS) -o qmake.exe $(OBJS) $(QTOBJS) $(LIBS) ADDCLEAN = diff --git a/qmake/Makefile.win32-g++-sh b/qmake/Makefile.win32-g++-sh index 9c7942c3ca..6ca75149dd 100644 --- a/qmake/Makefile.win32-g++-sh +++ b/qmake/Makefile.win32-g++-sh @@ -28,7 +28,7 @@ CFLAGS = -c -o$@ -O \ -DQT_BOOTSTRAPPED -DQLIBRARYINFO_EPOCROOT CXXFLAGS = $(CFLAGS) LFLAGS = -static-libgcc -static-libstdc++ -s -LIBS = -lole32 -luuid +LIBS = -lole32 -luuid -ladvapi32 -lkernel32 LINKQMAKE = g++ $(LFLAGS) -o qmake.exe $(OBJS) $(QTOBJS) $(LIBS) ADDCLEAN = diff --git a/qmake/qmake.pri b/qmake/qmake.pri index 8f46a2eb7f..3a0ab124a4 100644 --- a/qmake/qmake.pri +++ b/qmake/qmake.pri @@ -135,7 +135,7 @@ bootstrap { #Qt code SOURCES += qfsfileengine_win.cpp qfsfileengine_iterator_win.cpp qsettings_win.cpp \ qsystemlibrary.cpp win32-msvc*:LIBS += ole32.lib advapi32.lib - win32-g++*:LIBS += -lole32 -luuid + win32-g++*:LIBS += -lole32 -luuid -ladvapi32 -lkernel32 } qnx { -- cgit v1.2.1 From 0dc9c8eb8535b1a678360e4d3183f0b1b5e79db3 Mon Sep 17 00:00:00 2001 From: "Darryl L. Miles" Date: Fri, 8 Apr 2011 12:10:42 +0200 Subject: Add support for -unset option to qmake. Merge-request: 1175 Reviewed-by: Oswald Buddenhagen --- qmake/main.cpp | 4 +++- qmake/option.cpp | 6 +++++- qmake/option.h | 5 +++-- qmake/property.cpp | 14 ++++++++++++++ qmake/property.h | 1 + 5 files changed, 26 insertions(+), 4 deletions(-) (limited to 'qmake') diff --git a/qmake/main.cpp b/qmake/main.cpp index 7dab23d11b..7d4d458b0d 100644 --- a/qmake/main.cpp +++ b/qmake/main.cpp @@ -126,7 +126,9 @@ int runQMake(int argc, char **argv) } QMakeProperty prop; - if(Option::qmake_mode == Option::QMAKE_QUERY_PROPERTY || Option::qmake_mode == Option::QMAKE_SET_PROPERTY) + if(Option::qmake_mode == Option::QMAKE_QUERY_PROPERTY || + Option::qmake_mode == Option::QMAKE_SET_PROPERTY || + Option::qmake_mode == Option::QMAKE_UNSET_PROPERTY) return prop.exec() ? 0 : 101; QMakeProject project(&prop); diff --git a/qmake/option.cpp b/qmake/option.cpp index 1354281cef..c1b43e8cca 100644 --- a/qmake/option.cpp +++ b/qmake/option.cpp @@ -192,6 +192,7 @@ bool usage(const char *a0) " -norecursive Don't do a recursive search\n" " -recursive Do a recursive search\n" " -set Set persistent property\n" + " -unset Unset persistent property\n" " -query Query persistent property. Show all if is empty.\n" " -cache file Use file as cache [makefile mode only]\n" " -spec spec Use spec as QMAKESPEC [makefile mode only]\n" @@ -226,6 +227,8 @@ Option::parseCommandLine(int argc, char **argv, int skip) Option::qmake_mode = Option::QMAKE_GENERATE_PRL; } else if(opt == "set") { Option::qmake_mode = Option::QMAKE_SET_PROPERTY; + } else if(opt == "unset") { + Option::qmake_mode = Option::QMAKE_UNSET_PROPERTY; } else if(opt == "query") { Option::qmake_mode = Option::QMAKE_QUERY_PROPERTY; } else if(opt == "makefile") { @@ -336,7 +339,8 @@ Option::parseCommandLine(int argc, char **argv, int skip) } else { bool handled = true; if(Option::qmake_mode == Option::QMAKE_QUERY_PROPERTY || - Option::qmake_mode == Option::QMAKE_SET_PROPERTY) { + Option::qmake_mode == Option::QMAKE_SET_PROPERTY || + Option::qmake_mode == Option::QMAKE_UNSET_PROPERTY) { Option::prop::properties.append(arg); } else { QFileInfo fi(arg); diff --git a/qmake/option.h b/qmake/option.h index bc873438e1..e17ce5a3a0 100644 --- a/qmake/option.h +++ b/qmake/option.h @@ -148,8 +148,9 @@ struct Option } //global qmake mode, can only be in one mode per invocation! - enum QMAKE_MODE { QMAKE_GENERATE_NOTHING, QMAKE_GENERATE_PROJECT, QMAKE_GENERATE_MAKEFILE, - QMAKE_GENERATE_PRL, QMAKE_SET_PROPERTY, QMAKE_QUERY_PROPERTY }; + enum QMAKE_MODE { QMAKE_GENERATE_NOTHING, + QMAKE_GENERATE_PROJECT, QMAKE_GENERATE_MAKEFILE, QMAKE_GENERATE_PRL, + QMAKE_SET_PROPERTY, QMAKE_UNSET_PROPERTY, QMAKE_QUERY_PROPERTY }; static QMAKE_MODE qmake_mode; //all modes diff --git a/qmake/property.cpp b/qmake/property.cpp index d84f8e1ab9..0c36c1cc59 100644 --- a/qmake/property.cpp +++ b/qmake/property.cpp @@ -160,6 +160,13 @@ QMakeProperty::setValue(QString var, const QString &val) settings->setValue(keyBase() + var, val); } +void +QMakeProperty::remove(const QString &var) +{ + initSettings(); + settings->remove(keyBase() + var); +} + bool QMakeProperty::exec() { @@ -230,6 +237,13 @@ QMakeProperty::exec() if(!var.startsWith(".")) setValue(var, (*it)); } + } else if(Option::qmake_mode == Option::QMAKE_UNSET_PROPERTY) { + for(QStringList::ConstIterator it = Option::prop::properties.begin(); + it != Option::prop::properties.end(); it++) { + QString var = (*it); + if(!var.startsWith(".")) + remove(var); + } } return ret; } diff --git a/qmake/property.h b/qmake/property.h index 43b7529251..5e8379e787 100644 --- a/qmake/property.h +++ b/qmake/property.h @@ -62,6 +62,7 @@ public: bool hasValue(QString); QString value(QString v) { return value(v, false); } void setValue(QString, const QString &); + void remove(const QString &); bool exec(); }; -- cgit v1.2.1 From 7f8773a209567fb9c962602b8b1f4ec70e38ea51 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 22 Mar 2011 20:08:22 +0100 Subject: prefix TEMPLATE_PREFIX to TEMPLATE even if it is "default-constructed" that way prf files don't have to check both the prefix and the actual template to identify visual studio mode. Reviewed-by: mariusSO --- qmake/project.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'qmake') diff --git a/qmake/project.cpp b/qmake/project.cpp index e985401cc7..16200f14e5 100644 --- a/qmake/project.cpp +++ b/qmake/project.cpp @@ -3028,17 +3028,17 @@ QStringList &QMakeProject::values(const QString &_var, QMap Date: Wed, 23 Mar 2011 12:31:48 +0100 Subject: useful location reporting for errors from QMAKE_SUBSTITUTES Reviewed-by: mariusSO --- qmake/generators/makefile.cpp | 2 +- qmake/project.cpp | 14 ++++++++++++++ qmake/project.h | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) (limited to 'qmake') diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index c13f38ebdb..f9eba22f64 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -545,7 +545,7 @@ MakefileGenerator::init() else state.pop(); } else if(state.isEmpty() || state.top() == IN_CONDITION) { - contents += project->expand(line).join(QString(Option::field_sep)); + contents += project->expand(line, in.fileName(), count); } } if(out.exists() && out.open(QFile::ReadOnly)) { diff --git a/qmake/project.cpp b/qmake/project.cpp index 16200f14e5..d4f21bebd7 100644 --- a/qmake/project.cpp +++ b/qmake/project.cpp @@ -2773,6 +2773,20 @@ QMakeProject::expand(const QString &str) return QStringList(); } +QString +QMakeProject::expand(const QString &str, const QString &file, int line) +{ + bool ok; + parser_info pi = parser; + parser.file = file; + parser.line_no = line; + parser.from_file = false; + QMap tmp = vars; + const QStringList ret = doVariableReplaceExpand(str, tmp, &ok); + parser = pi; + return ok ? ret.join(QString(Option::field_sep)) : QString(); +} + QStringList QMakeProject::expand(const QString &func, const QList &args) { diff --git a/qmake/project.h b/qmake/project.h index 09aa45e730..0e6131d3a2 100644 --- a/qmake/project.h +++ b/qmake/project.h @@ -144,6 +144,7 @@ public: QMap &place); QStringList expand(const QString &v); + QString expand(const QString &v, const QString &file, int line); QStringList expand(const QString &func, const QList &args); bool test(const QString &v); bool test(const QString &func, const QList &args); -- cgit v1.2.1 From 3aa39b0164ce4bb9e551feb0417990e5679c5209 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 23 Mar 2011 17:07:36 +0100 Subject: create a pwd string with a trailing slash only on demand Reviewed-by: mariusSO --- qmake/generators/makefile.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'qmake') diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index f9eba22f64..f5b729512a 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -2825,9 +2825,6 @@ MakefileGenerator::fileFixify(const QString& file, const QString &out_d, const Q return cacheVal; //do the fixin' - QString pwd = qmake_getpwd(); - if (!pwd.endsWith('/')) - pwd += '/'; QString orig_file = ret; if(ret.startsWith(QLatin1Char('~'))) { if(ret.startsWith(QLatin1String("~/"))) @@ -2836,12 +2833,16 @@ MakefileGenerator::fileFixify(const QString& file, const QString &out_d, const Q warn_msg(WarnLogic, "Unable to expand ~ in %s", ret.toLatin1().constData()); } if(fix == FileFixifyAbsolute || (fix == FileFixifyDefault && project->isActiveConfig("no_fixpath"))) { - if(fix == FileFixifyAbsolute && QDir::isRelativePath(ret)) //already absolute + if(fix == FileFixifyAbsolute && QDir::isRelativePath(ret)) { //already absolute + QString pwd = qmake_getpwd(); + if (!pwd.endsWith(QLatin1Char('/'))) + pwd += QLatin1Char('/'); ret.prepend(pwd); + } ret = Option::fixPathToTargetOS(ret, false, canon); } else { //fix it.. QString out_dir = QDir(Option::output_dir).absoluteFilePath(out_d); - QString in_dir = QDir(pwd).absoluteFilePath(in_d); + QString in_dir = QDir(qmake_getpwd()).absoluteFilePath(in_d); { QFileInfo in_fi(fileInfo(in_dir)); if(in_fi.exists()) @@ -2907,7 +2908,7 @@ MakefileGenerator::fileFixify(const QString& file, const QString &out_d, const Q ret = "."; debug_msg(3, "Fixed[%d,%d] %s :: to :: %s [%s::%s] [%s::%s]", fix, canon, orig_file.toLatin1().constData(), ret.toLatin1().constData(), in_d.toLatin1().constData(), out_d.toLatin1().constData(), - pwd.toLatin1().constData(), Option::output_dir.toLatin1().constData()); + qmake_getpwd().toLatin1().constData(), Option::output_dir.toLatin1().constData()); cache->insert(cacheKey, ret); return ret; } -- cgit v1.2.1 From 11604357fccb59f7aba8165ea7ca8846eb820858 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 24 Mar 2011 12:58:15 +0100 Subject: stop fixifying after first success somewhat unlikely that this had much real-world effects ... except eating yet more cpu. Reviewed-by: mariusSO --- qmake/generators/makefile.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'qmake') diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index f5b729512a..9c22ca4c1b 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -2896,6 +2896,7 @@ MakefileGenerator::fileFixify(const QString& file, const QString &out_d, const Q //prepend for(int o = 0; o < i; o++) dot_prefix += ".." + Option::dir_sep; + break; } } ret.prepend(dot_prefix); -- cgit v1.2.1 From af93be4d81d1e50b0c9f015f8432033cc737b22d Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 29 Mar 2011 10:22:10 +0200 Subject: simplify: the input and output dirs are already normalized Reviewed-by: mariusSO --- qmake/generators/makefile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qmake') diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 9c22ca4c1b..7033a04867 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -782,7 +782,7 @@ MakefileGenerator::init() } { //get the output_dir into the pwd - if(fileFixify(Option::output_dir) != fileFixify(qmake_getpwd())) + if(Option::output_dir != qmake_getpwd()) project->values("INCLUDEPATH").append(fileFixify(Option::output_dir, Option::output_dir, Option::output_dir)); -- cgit v1.2.1 From 2fe0805d4eb821d2aa11ea868ebb3ff32a108475 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 29 Mar 2011 10:24:15 +0200 Subject: simplify: fileFixify for all same paths is always "." this must have been the most arcane way to generate a single dot ever Reviewed-by: mariusSO --- qmake/generators/makefile.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'qmake') diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 7033a04867..1bfbdba256 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -783,9 +783,7 @@ MakefileGenerator::init() { //get the output_dir into the pwd if(Option::output_dir != qmake_getpwd()) - project->values("INCLUDEPATH").append(fileFixify(Option::output_dir, - Option::output_dir, - Option::output_dir)); + project->values("INCLUDEPATH").append("."); } //fix up the target deps -- cgit v1.2.1 From c74f29f28f2bfee8335820a67598d16e850e9444 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 29 Mar 2011 10:28:27 +0200 Subject: simplify: absolute fixification ignores the base dir arguments Reviewed-by: mariusSO --- qmake/generators/makefile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qmake') diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 1bfbdba256..815980458f 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -2460,7 +2460,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QListprofile.isEmpty()) { QString out = subtarget->makefile; - QString in = fileFixify(in_directory + subtarget->profile, out_directory, QString(), FileFixifyAbsolute); + QString in = fileFixify(in_directory + subtarget->profile, FileFixifyAbsolute); if(out.startsWith(in_directory)) out = out.mid(in_directory.length()); t << mkfile << ": " << "\n\t"; -- cgit v1.2.1 From 9df9d83085ff6164d83c35d51df539858ae398e4 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 29 Mar 2011 10:28:51 +0200 Subject: fix paths of vpath-resolved files Task-number: QTBUG-8169 Reviewed-by: mariusSO --- qmake/generators/makefile.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'qmake') diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 815980458f..7eccc2e2ff 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -364,7 +364,7 @@ MakefileGenerator::findFilesInVPATH(QStringList l, uchar flags, const QString &v dir = regex.left(regex.lastIndexOf(Option::dir_sep) + 1); real_dir = dir; if(!(flags & VPATH_NoFixify)) - real_dir = fileFixify(real_dir, qmake_getpwd(), Option::output_dir); + real_dir = fileFixify(real_dir, qmake_getpwd(), Option::output_dir) + '/'; regex.remove(0, dir.length()); } if(real_dir.isEmpty() || exists(real_dir)) { @@ -383,16 +383,15 @@ MakefileGenerator::findFilesInVPATH(QStringList l, uchar flags, const QString &v for(int i = (int)files.count()-1; i >= 0; i--) { if(files[i] == "." || files[i] == "..") continue; - a = dir + files[i]; + a = real_dir + files[i]; if(!(flags & VPATH_NoFixify)) a = fileFixify(a); l.insert(val_it, a); } } } else { - debug_msg(1, "%s:%d Cannot match %s%c%s, as %s does not exist.", + debug_msg(1, "%s:%d Cannot match %s%s, as %s does not exist.", __FILE__, __LINE__, real_dir.toLatin1().constData(), - QDir::separator().toLatin1(), regex.toLatin1().constData(), real_dir.toLatin1().constData()); if(flags & VPATH_RemoveMissingFiles) remove_file = true; -- cgit v1.2.1 From 430b743946178c3f05208434331b8017159612b1 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 29 Mar 2011 10:33:45 +0200 Subject: dist target: fixify OBJECTS_DIR against output dir the thing is terminally broken anyway, but whatever Reviewed-by: mariusSO --- qmake/generators/unix/unixmake2.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'qmake') diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index c660855e94..c0c0aaaefc 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -787,7 +787,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) ddir = project->first("QMAKE_DISTDIR"); QString ddir_c = escapeFilePath(fileFixify((project->isEmpty("OBJECTS_DIR") ? QString(".tmp/") : - project->first("OBJECTS_DIR")) + ddir)); + project->first("OBJECTS_DIR")) + ddir, + Option::output_dir, Option::output_dir)); t << "dist: " << "\n\t" << mkdir_p_asstring(ddir_c) << "\n\t" << "$(COPY_FILE) --parents $(SOURCES) $(DIST) " << ddir_c << Option::dir_sep << " && "; -- cgit v1.2.1 From 26dd9a45c3b1e92c356ee7f80f728e2ddca0c1d8 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 29 Mar 2011 13:56:23 +0200 Subject: fix fixifying of QMAKE_SUBSTITUTES use the correct bases. notably, don't expect the input file in the output dir. Reviewed-by: mariusSO --- qmake/generators/makefile.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'qmake') diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 7eccc2e2ff..d096eb4dfe 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -483,19 +483,22 @@ MakefileGenerator::init() subs.at(i).toLatin1().constData()); continue; } - inn = tinn.first(); - outn = toutn.first(); + inn = fileFixify(tinn.first(), qmake_getpwd()); + outn = fileFixify(toutn.first(), qmake_getpwd(), Option::output_dir); } else { - inn = subs.at(i); + inn = fileFixify(subs.at(i), qmake_getpwd()); + if (!QFile::exists(inn)) { + // random insanity for backwards compat: .in file specified with absolute out dir + inn = fileFixify(subs.at(i)); + } if(!inn.endsWith(".in")) { warn_msg(WarnLogic, "Substitute '%s' does not end with '.in'", inn.toLatin1().constData()); continue; } - outn = inn.left(inn.length()-3); + outn = fileFixify(inn.left(inn.length()-3), qmake_getpwd(), Option::output_dir); } - QFile in(fileFixify(inn)); - QFile out(fileFixify(outn, qmake_getpwd(), Option::output_dir)); + QFile in(inn); if(in.open(QFile::ReadOnly)) { QString contents; QStack state; @@ -547,6 +550,7 @@ MakefileGenerator::init() contents += project->expand(line, in.fileName(), count); } } + QFile out(outn); if(out.exists() && out.open(QFile::ReadOnly)) { QString old = QString::fromUtf8(out.readAll()); if(contents == old) { -- cgit v1.2.1 From 8b11ebf392d832725185de08c2438d6b8771890b Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 29 Mar 2011 14:42:35 +0200 Subject: fixify target source against build tree that's where one would expect a target, after all. affects only extra targets explicitly requesting fixification, i.e., nothing. Reviewed-by: mariusSO --- qmake/generators/makefile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qmake') diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index d096eb4dfe..3c5948fd34 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -1747,7 +1747,7 @@ MakefileGenerator::writeExtraTargets(QTextStream &t) deps += " " + escapeDependencyPath(dep); } if(project->values((*it) + ".CONFIG").indexOf("fix_target") != -1) - targ = fileFixify(targ); + targ = fileFixify(targ, Option::output_dir, Option::output_dir); if(project->isEmpty("QMAKE_NOFORCE") && project->values((*it) + ".CONFIG").indexOf("phony") != -1) deps += QString(" ") + "FORCE"; -- cgit v1.2.1 From a5be47714e5a0075fe9d0ea4a7925136a48e3974 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 29 Mar 2011 11:54:38 +0200 Subject: run depend_command in build dir in VS generators as well followup to b139e7e96e5c47b412c4f0bbc4ae11d5cca99e61 Reviewed-by: mariusSO --- qmake/generators/win32/msbuild_objectmodel.cpp | 5 ++++- qmake/generators/win32/msvc_objectmodel.cpp | 5 ++++- qmake/generators/win32/msvc_vcproj.cpp | 6 +++++- qmake/generators/win32/msvc_vcxproj.cpp | 6 +++++- 4 files changed, 18 insertions(+), 4 deletions(-) (limited to 'qmake') diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp index bd941787c6..01f730ac38 100644 --- a/qmake/generators/win32/msbuild_objectmodel.cpp +++ b/qmake/generators/win32/msbuild_objectmodel.cpp @@ -2438,6 +2438,9 @@ bool VCXFilter::addExtraCompiler(const VCXFilterFile &info) char buff[256]; QString dep_cmd = Project->replaceExtraCompilerVariables(tmp_dep_cmd, Option::fixPathToLocalOS(inFile, true, false), out); if(Project->canExecute(dep_cmd)) { + dep_cmd.prepend(QLatin1String("cd ") + + Project->escapeFilePath(Option::fixPathToLocalOS(Option::output_dir, false)) + + QLatin1String(" && ")); if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) { QString indeps; while(!feof(proc)) { @@ -2452,7 +2455,7 @@ bool VCXFilter::addExtraCompiler(const VCXFilterFile &info) for (int i = 0; i < extradeps.count(); ++i) { QString dd = extradeps.at(i).simplified(); if (!dd.isEmpty()) - deps += Project->fileFixify(dd); + deps += Project->fileFixify(dd, QString(), Option::output_dir); } } } diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index 87c89435ba..0a24a01953 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -2218,6 +2218,9 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info) Option::fixPathToLocalOS(inFile, true, false), out); if(Project->canExecute(dep_cmd)) { + dep_cmd.prepend(QLatin1String("cd ") + + Project->escapeFilePath(Option::fixPathToLocalOS(Option::output_dir, false)) + + QLatin1String(" && ")); if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) { QString indeps; while(!feof(proc)) { @@ -2232,7 +2235,7 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info) for (int i = 0; i < extradeps.count(); ++i) { QString dd = extradeps.at(i).simplified(); if (!dd.isEmpty()) - deps += Project->fileFixify(dd); + deps += Project->fileFixify(dd, QString(), Option::output_dir); } } } diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 364eca034e..10934a50b6 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -1302,6 +1302,9 @@ void VcprojGenerator::initResourceFiles() dep_cmd = Option::fixPathToLocalOS(dep_cmd, true, false); if(canExecute(dep_cmd)) { + dep_cmd.prepend(QLatin1String("cd ") + + escapeFilePath(Option::fixPathToLocalOS(Option::output_dir, false)) + + QLatin1String(" && ")); if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) { QString indeps; while(!feof(proc)) { @@ -1312,7 +1315,8 @@ void VcprojGenerator::initResourceFiles() } QT_PCLOSE(proc); if(!indeps.isEmpty()) - deps += fileFixify(indeps.replace('\n', ' ').simplified().split(' ')); + deps += fileFixify(indeps.replace('\n', ' ').simplified().split(' '), + QString(), Option::output_dir); } } } diff --git a/qmake/generators/win32/msvc_vcxproj.cpp b/qmake/generators/win32/msvc_vcxproj.cpp index 2b628a5755..e2464ec2d0 100644 --- a/qmake/generators/win32/msvc_vcxproj.cpp +++ b/qmake/generators/win32/msvc_vcxproj.cpp @@ -654,6 +654,9 @@ void VcxprojGenerator::initResourceFiles() dep_cmd = Option::fixPathToLocalOS(dep_cmd, true, false); if(canExecute(dep_cmd)) { + dep_cmd.prepend(QLatin1String("cd ") + + escapeFilePath(Option::fixPathToLocalOS(Option::output_dir, false)) + + QLatin1String(" && ")); if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) { QString indeps; while(!feof(proc)) { @@ -664,7 +667,8 @@ void VcxprojGenerator::initResourceFiles() } QT_PCLOSE(proc); if(!indeps.isEmpty()) - deps += fileFixify(indeps.replace('\n', ' ').simplified().split(' ')); + deps += fileFixify(indeps.replace('\n', ' ').simplified().split(' '), + QString(), Option::output_dir); } } } -- cgit v1.2.1 From 8caba032245dfa310a77c22c1e55137c54e59f4f Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 29 Mar 2011 17:10:35 +0200 Subject: make collection of SUBDIRS in solution generator less bizarre de-duplicate code, and on the way don't try to re-resolve project variables of subprojects against the contents of the top level project. Reviewed-by: mariusSO --- qmake/generators/win32/msvc_vcproj.cpp | 42 +++++++++++++++++----------------- qmake/generators/win32/msvc_vcproj.h | 1 + 2 files changed, 22 insertions(+), 21 deletions(-) (limited to 'qmake') diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 10934a50b6..5005190e71 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -352,6 +352,25 @@ QUuid VcprojGenerator::increaseUUID(const QUuid &id) return result; } +QStringList VcprojGenerator::collectSubDirs(QMakeProject *proj) +{ + QStringList subdirs; + QStringList tmp_proj_subdirs = proj->variables()["SUBDIRS"]; + for(int x = 0; x < tmp_proj_subdirs.size(); ++x) { + QString tmpdir = tmp_proj_subdirs.at(x); + if(!proj->isEmpty(tmpdir + ".file")) { + if(!proj->isEmpty(tmpdir + ".subdir")) + warn_msg(WarnLogic, "Cannot assign both file and subdir for subdir %s", + tmpdir.toLatin1().constData()); + tmpdir = proj->first(tmpdir + ".file"); + } else if(!proj->isEmpty(tmpdir + ".subdir")) { + tmpdir = proj->first(tmpdir + ".subdir"); + } + subdirs += tmpdir; + } + return subdirs; +} + void VcprojGenerator::writeSubDirs(QTextStream &t) { // Check if all requirements are fulfilled @@ -386,7 +405,6 @@ void VcprojGenerator::writeSubDirs(QTextStream &t) QHash solution_depends; QList solution_cleanup; - QStringList subdirs = project->values("SUBDIRS"); QString oldpwd = qmake_getpwd(); // Make sure that all temp projects are configured @@ -395,16 +413,9 @@ void VcprojGenerator::writeSubDirs(QTextStream &t) QStringList old_after_vars = Option::after_user_vars; Option::after_user_vars.append("CONFIG+=release"); + QStringList subdirs = collectSubDirs(project); for(int i = 0; i < subdirs.size(); ++i) { QString tmp = subdirs.at(i); - if(!project->isEmpty(tmp + ".file")) { - if(!project->isEmpty(tmp + ".subdir")) - warn_msg(WarnLogic, "Cannot assign both file and subdir for subdir %s", - tmp.toLatin1().constData()); - tmp = project->first(tmp + ".file"); - } else if(!project->isEmpty(tmp + ".subdir")) { - tmp = project->first(tmp + ".subdir"); - } QFileInfo fi(fileInfo(Option::fixPathToLocalOS(tmp, true))); if(fi.exists()) { if(fi.isDir()) { @@ -428,19 +439,8 @@ void VcprojGenerator::writeSubDirs(QTextStream &t) continue; } if(tmp_proj.first("TEMPLATE") == "vcsubdirs") { - QStringList tmp_proj_subdirs = tmp_proj.variables()["SUBDIRS"]; - for(int x = 0; x < tmp_proj_subdirs.size(); ++x) { - QString tmpdir = tmp_proj_subdirs.at(x); - if(!tmp_proj.isEmpty(tmpdir + ".file")) { - if(!tmp_proj.isEmpty(tmpdir + ".subdir")) - warn_msg(WarnLogic, "Cannot assign both file and subdir for subdir %s", - tmpdir.toLatin1().constData()); - tmpdir = tmp_proj.first(tmpdir + ".file"); - } else if(!tmp_proj.isEmpty(tmpdir + ".subdir")) { - tmpdir = tmp_proj.first(tmpdir + ".subdir"); - } + foreach(const QString &tmpdir, collectSubDirs(&tmp_proj)) subdirs += fileFixify(tmpdir); - } } else if(tmp_proj.first("TEMPLATE") == "vcapp" || tmp_proj.first("TEMPLATE") == "vclib") { // Initialize a 'fake' project to get the correct variables // and to be able to extract all the dependencies diff --git a/qmake/generators/win32/msvc_vcproj.h b/qmake/generators/win32/msvc_vcproj.h index 8e55211cf4..d66c029fd9 100644 --- a/qmake/generators/win32/msvc_vcproj.h +++ b/qmake/generators/win32/msvc_vcproj.h @@ -130,6 +130,7 @@ protected: QList mergedProjects; private: + QStringList collectSubDirs(QMakeProject *proj); QUuid increaseUUID(const QUuid &id); friend class VCFilter; }; -- cgit v1.2.1 From e22e36bc61b4af7c0a9113617df5a35ed315dede Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 29 Mar 2011 20:17:18 +0200 Subject: look for makespec in the build dir first it's more natural to look into the build dir before the source dir, and it's what the qmake-generated makefiles mean when re-invoking qmake. specifically, this works around the problem that relative paths with excess ".."s pointing below the root are happily ignored and thus truly bizarre makespec paths may be constructed by the qmake re-invocations if the source dir is less nested than the build dir. Task-number: QTBUG-9817 Reviewed-by: mariusSO --- qmake/project.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'qmake') diff --git a/qmake/project.cpp b/qmake/project.cpp index d4f21bebd7..177ab2fbd4 100644 --- a/qmake/project.cpp +++ b/qmake/project.cpp @@ -1345,10 +1345,10 @@ QMakeProject::read(uchar cmd) } if(QDir::isRelativePath(qmakespec)) { - if (QFile::exists(qmakespec+"/qmake.conf")) { - Option::mkfile::qmakespec = QFileInfo(Option::mkfile::qmakespec).absoluteFilePath(); - } else if (QFile::exists(Option::output_dir+"/"+qmakespec+"/qmake.conf")) { + if (QFile::exists(Option::output_dir+"/"+qmakespec+"/qmake.conf")) { qmakespec = Option::mkfile::qmakespec = QFileInfo(Option::output_dir+"/"+qmakespec).absoluteFilePath(); + } else if (QFile::exists(qmakespec+"/qmake.conf")) { + Option::mkfile::qmakespec = QFileInfo(Option::mkfile::qmakespec).absoluteFilePath(); } else { bool found_mkspec = false; for(QStringList::ConstIterator it = mkspec_roots.begin(); it != mkspec_roots.end(); ++it) { -- cgit v1.2.1 From 63bf7cd581d9f69fecae82921d5c2c5b5eddc04a Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 19 Apr 2011 12:05:48 +0200 Subject: Fix wrong merge of 3aa39b0164ce4bb9e --- qmake/generators/makefile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qmake') diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 83d3adfdb5..4f3b1137f5 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -2901,7 +2901,7 @@ MakefileGenerator::fileFixify(const QString& file, const QString &out_d, const Q ret = "."; debug_msg(3, "Fixed[%d,%d] %s :: to :: %s [%s::%s] [%s::%s]", fix, canon, orig_file.toLatin1().constData(), ret.toLatin1().constData(), in_d.toLatin1().constData(), out_d.toLatin1().constData(), - pwd.toLatin1().constData(), Option::output_dir.toLatin1().constData()); + qmake_getpwd().toLatin1().constData(), Option::output_dir.toLatin1().constData()); return ret; } -- cgit v1.2.1 From 56443421cb5e537e60abd7ced42c9ebf587683fe Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 3 May 2011 15:30:28 +0200 Subject: qmake: Introduce new template type The template type "aux" is intended for projects that do not require building anything, but may need to install stuff (e.g. applications with QML entry point). Reviewed-by: Joerg Bornemann --- qmake/generators/unix/unixmake2.cpp | 6 +++++- qmake/generators/win32/borland_bmake.cpp | 8 +++++++- qmake/generators/win32/mingw_make.cpp | 8 +++++++- qmake/generators/win32/msvc_nmake.cpp | 8 +++++++- 4 files changed, 26 insertions(+), 4 deletions(-) (limited to 'qmake') diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 9f144929ed..82f2366349 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -96,7 +96,8 @@ UnixMakefileGenerator::writeMakefile(QTextStream &t) } if (project->values("TEMPLATE").first() == "app" || - project->values("TEMPLATE").first() == "lib") { + project->values("TEMPLATE").first() == "lib" || + project->values("TEMPLATE").first() == "aux") { if(Option::mkfile::do_stub_makefile && MakefileGenerator::writeStubMakefile(t)) return true; writeMakeParts(t); @@ -1017,6 +1018,9 @@ void UnixMakefileGenerator::init2() if(project->isEmpty("QMAKE_FRAMEWORK_VERSION")) project->values("QMAKE_FRAMEWORK_VERSION").append(project->values("VER_MAJ").first()); + if (project->values("TEMPLATE").first() == "aux") + return; + if (!project->values("QMAKE_APP_FLAG").isEmpty()) { if(!project->isEmpty("QMAKE_BUNDLE")) { QString bundle_loc = project->first("QMAKE_BUNDLE_LOCATION"); diff --git a/qmake/generators/win32/borland_bmake.cpp b/qmake/generators/win32/borland_bmake.cpp index 585a0f4982..1f7de00c2e 100644 --- a/qmake/generators/win32/borland_bmake.cpp +++ b/qmake/generators/win32/borland_bmake.cpp @@ -68,7 +68,8 @@ BorlandMakefileGenerator::writeMakefile(QTextStream &t) } if(project->first("TEMPLATE") == "app" || - project->first("TEMPLATE") == "lib") { + project->first("TEMPLATE") == "lib" || + project->first("TEMPLATE") == "aux") { writeBorlandParts(t); return MakefileGenerator::writeMakefile(t); } @@ -136,6 +137,11 @@ BorlandMakefileGenerator::init() void BorlandMakefileGenerator::writeBuildRulesPart(QTextStream &t) { + if (project->first("TEMPLATE") == "aux") { + t << "first:" << endl; + return; + } + t << "first: all" << endl; t << "all: " << fileFixify(Option::output.fileName()) << " " << varGlue("ALL_DEPS"," "," "," ") << " $(DESTDIR_TARGET)" << endl << endl; t << "$(DESTDIR_TARGET): " << var("PRE_TARGETDEPS") << " $(OBJECTS) " << var("POST_TARGETDEPS"); diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp index 462920e06c..0d15cfbad2 100644 --- a/qmake/generators/win32/mingw_make.cpp +++ b/qmake/generators/win32/mingw_make.cpp @@ -141,7 +141,8 @@ bool MingwMakefileGenerator::writeMakefile(QTextStream &t) } if(project->first("TEMPLATE") == "app" || - project->first("TEMPLATE") == "lib") { + project->first("TEMPLATE") == "lib" || + project->first("TEMPLATE") == "aux") { if(project->isActiveConfig("create_pc") && project->first("TEMPLATE") == "lib") writePkgConfigFile(); @@ -436,6 +437,11 @@ void MingwMakefileGenerator::writeObjectsPart(QTextStream &t) void MingwMakefileGenerator::writeBuildRulesPart(QTextStream &t) { + if (project->first("TEMPLATE") == "aux") { + t << "first:" << endl; + return; + } + t << "first: all" << endl; t << "all: " << escapeDependencyPath(fileFixify(Option::output.fileName())) << " " << valGlue(escapeDependencyPaths(project->values("ALL_DEPS"))," "," "," ") << " $(DESTDIR_TARGET)" << endl << endl; t << "$(DESTDIR_TARGET): " << var("PRE_TARGETDEPS") << " $(OBJECTS) " << var("POST_TARGETDEPS"); diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index c55806d002..0565c53256 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -70,7 +70,8 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t) } if(project->first("TEMPLATE") == "app" || - project->first("TEMPLATE") == "lib") { + project->first("TEMPLATE") == "lib" || + project->first("TEMPLATE") == "aux") { #if 0 if(Option::mkfile::do_stub_makefile) return MakefileGenerator::writeStubMakefile(t); @@ -332,6 +333,11 @@ void NmakeMakefileGenerator::writeImplicitRulesPart(QTextStream &t) void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t) { + if (project->first("TEMPLATE") == "aux") { + t << "first:" << endl; + return; + } + t << "first: all" << endl; t << "all: " << fileFixify(Option::output.fileName()) << " " << varGlue("ALL_DEPS"," "," "," ") << "$(DESTDIR_TARGET)" << endl << endl; t << "$(DESTDIR_TARGET): " << var("PRE_TARGETDEPS") << " $(OBJECTS) " << var("POST_TARGETDEPS"); -- cgit v1.2.1 From 23e772584531278e3b2a6c735ff9db88f7ffd76e Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 3 May 2011 09:52:30 +0200 Subject: qmake nmake generator: pass MAKEFLAGS to sub-make calls Unlike other make tools nmake doesn't do this automatically. Reviewed-by: ossi --- qmake/generators/makefile.cpp | 28 ++++++++++++++-------------- qmake/generators/makefile.h | 2 ++ qmake/generators/win32/msvc_nmake.cpp | 9 +++++++++ qmake/generators/win32/msvc_nmake.h | 2 ++ 4 files changed, 27 insertions(+), 14 deletions(-) (limited to 'qmake') diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 595768f4a3..c3d39335f8 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -2373,6 +2373,14 @@ MakefileGenerator::writeSubDirs(QTextStream &t) qDeleteAll(targets); } +void MakefileGenerator::writeSubMakeCall(QTextStream &t, const QString &callPrefix, + const QString &makeArguments, const QString &callPostfix) +{ + t << callPrefix + << "$(MAKE)" << makeArguments + << callPostfix << endl; +} + void MakefileGenerator::writeSubTargets(QTextStream &t, QList targets, int flags) { @@ -2496,9 +2504,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QListdepends); if(project->isEmpty("QMAKE_NOFORCE")) t << " FORCE"; - t << out_directory_cdin - << "$(MAKE)" << makefilein - << out_directory_cdout << endl; + writeSubMakeCall(t, out_directory_cdin, makefilein, out_directory_cdout); } for(int suffix = 0; suffix < targetSuffixes.size(); ++suffix) { @@ -2518,9 +2524,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QListtarget << "-" << targetSuffixes.at(suffix) << "-ordered "; if(project->isEmpty("QMAKE_NOFORCE")) t << " FORCE"; - t << out_directory_cdin - << "$(MAKE)" << makefilein << " " << s - << out_directory_cdout << endl; + writeSubMakeCall(t, out_directory_cdin, makefilein, out_directory_cdout); } t << subtarget->target << "-" << targetSuffixes.at(suffix) << ": " << mkfile; if(!subtarget->depends.isEmpty()) @@ -2528,9 +2532,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QListisEmpty("QMAKE_NOFORCE")) t << " FORCE"; - t << out_directory_cdin - << "$(MAKE)" << makefilein << " " << s - << out_directory_cdout << endl; + writeSubMakeCall(t, out_directory_cdin, makefilein, out_directory_cdout); } } t << endl; @@ -2664,12 +2666,10 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList findSubDirsSubTargets() const; + virtual void writeSubMakeCall(QTextStream &t, const QString &outDirectory_cdin, + const QString &makeFileIn, const QString &outDirectory_cdout); void writeSubTargets(QTextStream &t, QList subtargets, int flags); //extra compiler interface diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index c55806d002..e0e2fe0e79 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -85,6 +85,15 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t) return false; } +void NmakeMakefileGenerator::writeSubMakeCall(QTextStream &t, const QString &callPrefix, + const QString &makeArguments, const QString &callPostfix) +{ + // Pass MAKEFLAGS as environment variable to sub-make calls. + // Unlike other make tools nmake doesn't do this automatically. + t << "\n\t@set MAKEFLAGS=$(MAKEFLAGS)"; + Win32MakefileGenerator::writeSubMakeCall(t, callPrefix, makeArguments, callPostfix); +} + QString NmakeMakefileGenerator::getPdbTarget() { return QString(project->first("TARGET") + project->first("TARGET_VERSION_EXT") + ".pdb"); diff --git a/qmake/generators/win32/msvc_nmake.h b/qmake/generators/win32/msvc_nmake.h index 8954655672..689cc19479 100644 --- a/qmake/generators/win32/msvc_nmake.h +++ b/qmake/generators/win32/msvc_nmake.h @@ -57,6 +57,8 @@ class NmakeMakefileGenerator : public Win32MakefileGenerator void init(); protected: + virtual void writeSubMakeCall(QTextStream &t, const QString &callPrefix, + const QString &makeArguments, const QString &callPostfix); virtual QString getPdbTarget(); virtual QString defaultInstall(const QString &t); virtual QStringList &findDependencies(const QString &file); -- cgit v1.2.1 From b6c562d0ccf07983fc60d33e33086117744e205a Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 5 May 2011 14:04:22 +0200 Subject: qmake: remove dead code from VcxprojGenerator Reviewed-by: ossi --- qmake/generators/win32/msvc_vcxproj.cpp | 18 ------------------ qmake/generators/win32/msvc_vcxproj.h | 10 ---------- 2 files changed, 28 deletions(-) (limited to 'qmake') diff --git a/qmake/generators/win32/msvc_vcxproj.cpp b/qmake/generators/win32/msvc_vcxproj.cpp index 1e7c4b7a93..5b75cfa354 100644 --- a/qmake/generators/win32/msvc_vcxproj.cpp +++ b/qmake/generators/win32/msvc_vcxproj.cpp @@ -41,26 +41,9 @@ #include "msvc_vcxproj.h" #include "msbuild_objectmodel.h" -#include -#include -#include - - -QT_BEGIN_NAMESPACE -// Filter GUIDs (Do NOT change these!) ------------------------------ -const char _GUIDSourceFiles[] = "{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"; -const char _GUIDHeaderFiles[] = "{93995380-89BD-4b04-88EB-625FBE52EBFB}"; -const char _GUIDGeneratedFiles[] = "{71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11}"; -const char _GUIDResourceFiles[] = "{D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E}"; -const char _GUIDLexYaccFiles[] = "{E12AE0D2-192F-4d59-BD23-7D3FA58D3183}"; -const char _GUIDTranslationFiles[] = "{639EADAA-A684-42e4-A9AD-28FC9BCB8F7C}"; -const char _GUIDFormFiles[] = "{99349809-55BA-4b9d-BF79-8FDBB0286EB3}"; -const char _GUIDExtraCompilerFiles[] = "{E0D8C965-CC5F-43d7-AD63-FAEF0BBC0F85}"; -QT_END_NAMESPACE QT_BEGIN_NAMESPACE - VcxprojGenerator::VcxprojGenerator() : VcprojGenerator() { } @@ -71,4 +54,3 @@ VCProjectWriter *VcxprojGenerator::createProjectWriter() } QT_END_NAMESPACE - diff --git a/qmake/generators/win32/msvc_vcxproj.h b/qmake/generators/win32/msvc_vcxproj.h index 3283cc7493..90f665217e 100644 --- a/qmake/generators/win32/msvc_vcxproj.h +++ b/qmake/generators/win32/msvc_vcxproj.h @@ -42,8 +42,6 @@ #ifndef MSVC_VCXPROJ_H #define MSVC_VCXPROJ_H -#include "winmakefile.h" -#include "msbuild_objectmodel.h" #include "msvc_vcproj.h" QT_BEGIN_NAMESPACE @@ -52,19 +50,11 @@ class VcxprojGenerator : public VcprojGenerator { public: VcxprojGenerator(); - ~VcxprojGenerator(); protected: virtual VCProjectWriter *createProjectWriter(); - -private: - friend class VCFilter; - }; -inline VcxprojGenerator::~VcxprojGenerator() -{ } - QT_END_NAMESPACE #endif // MSVC_VCXPROJ_H -- cgit v1.2.1 From 3edf2608f572982f5ef7c89d4772d2d28b635c69 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 5 May 2011 10:51:27 +0200 Subject: qmake vc(x)proj generator: support x64 Qt builds Task-number: QTBUG-17911 Reviewed-by: ossi --- qmake/generators/win32/msvc_vcproj.cpp | 22 +++++++++++++--------- qmake/generators/win32/msvc_vcproj.h | 1 + 2 files changed, 14 insertions(+), 9 deletions(-) (limited to 'qmake') diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index f243e86632..06920e98e6 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -208,6 +208,7 @@ const char _slnExtSections[] = "\n\tGlobalSection(ExtensibilityGlobals) = pos VcprojGenerator::VcprojGenerator() : Win32MakefileGenerator(), init_flag(false), + is64Bit(false), projectWriter(0) { } @@ -597,14 +598,16 @@ nextfile: } } t << _slnGlobalBeg; + + QString slnConf = _slnSolutionConf; if (!project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH")) { - QString slnConfCE = _slnSolutionConf; - QString platform = QString("|") + project->values("CE_SDK").join(" ") + " (" + project->first("CE_ARCH") + ")"; - slnConfCE.replace(QString("|Win32"), platform); - t << slnConfCE; - } else { - t << _slnSolutionConf; + QString slnPlatform = QString("|") + project->values("CE_SDK").join(" ") + " (" + project->first("CE_ARCH") + ")"; + slnConf.replace(QString("|Win32"), slnPlatform); + } else if (is64Bit) { + slnConf.replace(QString("|Win32"), "|x64"); } + t << slnConf; + t << _slnProjDepBeg; // Restore previous after_user_var options @@ -621,7 +624,7 @@ nextfile: t << _slnProjDepEnd; t << _slnProjConfBeg; for(QList::Iterator it = solution_cleanup.begin(); it != solution_cleanup.end(); ++it) { - QString platform = "Win32"; + QString platform = is64Bit ? "x64" : "Win32"; if (!project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH")) platform = project->values("CE_SDK").join(" ") + " (" + project->first("CE_ARCH") + ")"; t << "\n\t\t" << (*it)->uuid << QString(_slnProjDbgConfTag1).arg(platform) << platform; @@ -661,6 +664,7 @@ void VcprojGenerator::init() if (init_flag) return; init_flag = true; + is64Bit = (project->first("QMAKE_TARGET.arch") == "x86_64"); projectWriter = createProjectWriter(); if(project->first("TEMPLATE") == "vcsubdirs") //too much work for subdirs @@ -831,7 +835,7 @@ void VcprojGenerator::initProject() vcProject.Keyword = project->first("VCPROJ_KEYWORD"); if (project->isEmpty("CE_SDK") || project->isEmpty("CE_ARCH")) { - vcProject.PlatformName = (vcProject.Configuration.idl.TargetEnvironment == midlTargetWin64 ? "Win64" : "Win32"); + vcProject.PlatformName = (is64Bit ? "x64" : "Win32"); } else { vcProject.PlatformName = project->values("CE_SDK").join(" ") + " (" + project->first("CE_ARCH") + ")"; } @@ -895,7 +899,7 @@ void VcprojGenerator::initConfiguration() conf.Name = isDebug ? "Debug" : "Release"; conf.ConfigurationName = conf.Name; if (project->isEmpty("CE_SDK") || project->isEmpty("CE_ARCH")) { - conf.Name += (conf.idl.TargetEnvironment == midlTargetWin64 ? "|Win64" : "|Win32"); + conf.Name += (is64Bit ? "|x64" : "|Win32"); } else { conf.Name += "|" + project->values("CE_SDK").join(" ") + " (" + project->first("CE_ARCH") + ")"; } diff --git a/qmake/generators/win32/msvc_vcproj.h b/qmake/generators/win32/msvc_vcproj.h index fdcd73f82d..497f5a7a88 100644 --- a/qmake/generators/win32/msvc_vcproj.h +++ b/qmake/generators/win32/msvc_vcproj.h @@ -57,6 +57,7 @@ struct QUuid; class VcprojGenerator : public Win32MakefileGenerator { bool init_flag; + bool is64Bit; bool writeVcprojParts(QTextStream &); bool writeMakefile(QTextStream &); -- cgit v1.2.1 From fab911a64a72d5b7f450f3f3616e38c96d601553 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 11 May 2011 12:24:46 +0200 Subject: fixup for 23e772584531278e3b2a6c735ff9db88f7ffd76e Reviewed-by: TrustMe --- qmake/generators/makefile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'qmake') diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index c3d39335f8..876886191c 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -2524,7 +2524,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QListtarget << "-" << targetSuffixes.at(suffix) << "-ordered "; if(project->isEmpty("QMAKE_NOFORCE")) t << " FORCE"; - writeSubMakeCall(t, out_directory_cdin, makefilein, out_directory_cdout); + writeSubMakeCall(t, out_directory_cdin, makefilein + " " + s, out_directory_cdout); } t << subtarget->target << "-" << targetSuffixes.at(suffix) << ": " << mkfile; if(!subtarget->depends.isEmpty()) @@ -2532,7 +2532,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QListisEmpty("QMAKE_NOFORCE")) t << " FORCE"; - writeSubMakeCall(t, out_directory_cdin, makefilein, out_directory_cdout); + writeSubMakeCall(t, out_directory_cdin, makefilein + " " + s, out_directory_cdout); } } t << endl; -- cgit v1.2.1