diff options
Diffstat (limited to 'qmake')
-rw-r--r-- | qmake/Makefile.unix | 13 | ||||
-rw-r--r-- | qmake/Makefile.win32 | 3 | ||||
-rw-r--r-- | qmake/doc/src/qmake-manual.qdoc | 10 | ||||
-rw-r--r-- | qmake/generators/makefile.cpp | 29 | ||||
-rw-r--r-- | qmake/generators/makefile.h | 1 | ||||
-rw-r--r-- | qmake/generators/makefiledeps.cpp | 183 | ||||
-rw-r--r-- | qmake/generators/makefiledeps.h | 27 | ||||
-rw-r--r-- | qmake/generators/metamakefile.cpp | 39 | ||||
-rw-r--r-- | qmake/generators/projectgenerator.cpp | 2 | ||||
-rw-r--r-- | qmake/generators/unix/unixmake.cpp | 7 | ||||
-rw-r--r-- | qmake/generators/unix/unixmake2.cpp | 38 | ||||
-rw-r--r-- | qmake/generators/win32/mingw_make.cpp | 6 | ||||
-rw-r--r-- | qmake/generators/win32/msbuild_objectmodel.cpp | 15 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_vcproj.cpp | 22 | ||||
-rw-r--r-- | qmake/generators/win32/winmakefile.cpp | 19 | ||||
-rw-r--r-- | qmake/generators/win32/winmakefile.h | 3 | ||||
-rw-r--r-- | qmake/generators/xmloutput.cpp | 10 | ||||
-rw-r--r-- | qmake/qmake.pro | 8 |
18 files changed, 189 insertions, 246 deletions
diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix index 68f173cd1b..e895feaef4 100644 --- a/qmake/Makefile.unix +++ b/qmake/Makefile.unix @@ -28,6 +28,7 @@ QOBJS = \ qmetatype.o qsystemerror.o qvariant.o \ quuid.o \ qarraydata.o qbitarray.o qbytearray.o qbytearraymatcher.o \ + qcalendar.o qgregoriancalendar.o qromancalendar.o \ qcryptographichash.o qdatetime.o qhash.o qlist.o \ qlocale.o qlocale_tools.o qmap.o qregexp.o qringbuffer.o \ qstringbuilder.o qstring.o qstringlist.o qversionnumber.o \ @@ -114,7 +115,10 @@ DEPEND_SRC = \ $(SOURCE_PATH)/src/corelib/text/qstring.cpp \ $(SOURCE_PATH)/src/corelib/text/qstringlist.cpp \ $(SOURCE_PATH)/src/corelib/text/qvsnprintf.cpp \ + $(SOURCE_PATH)/src/corelib/time/qcalendar.cpp \ $(SOURCE_PATH)/src/corelib/time/qdatetime.cpp \ + $(SOURCE_PATH)/src/corelib/time/qgregoriancalendar.cpp \ + $(SOURCE_PATH)/src/corelib/time/qromancalendar.cpp \ $(SOURCE_PATH)/src/corelib/tools/qarraydata.cpp \ $(SOURCE_PATH)/src/corelib/tools/qbitarray.cpp \ $(SOURCE_PATH)/src/corelib/tools/qcryptographichash.cpp \ @@ -428,6 +432,15 @@ qfileinfo.o: $(SOURCE_PATH)/src/corelib/io/qfileinfo.cpp qdatetime.o: $(SOURCE_PATH)/src/corelib/time/qdatetime.cpp $(CXX) -c -o $@ $(CXXFLAGS) $< +qcalendar.o: $(SOURCE_PATH)/src/corelib/time/qcalendar.cpp + $(CXX) -c -o $@ $(CXXFLAGS) $< + +qgregoriancalendar.o: $(SOURCE_PATH)/src/corelib/time/qgregoriancalendar.cpp + $(CXX) -c -o $@ $(CXXFLAGS) $< + +qromancalendar.o: $(SOURCE_PATH)/src/corelib/time/qromancalendar.cpp + $(CXX) -c -o $@ $(CXXFLAGS) $< + qstringlist.o: $(SOURCE_PATH)/src/corelib/text/qstringlist.cpp $(CXX) -c -o $@ $(CXXFLAGS) $< diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32 index 43059f9af0..672df47953 100644 --- a/qmake/Makefile.win32 +++ b/qmake/Makefile.win32 @@ -71,6 +71,7 @@ QTOBJS= \ qbytearray.obj \ qvsnprintf.obj \ qbytearraymatcher.obj \ + qcalendar.obj \ qdatetime.obj \ qdir.obj \ qdiriterator.obj \ @@ -83,6 +84,7 @@ QTOBJS= \ qfileinfo.obj \ qendian.obj \ qglobal.obj \ + qgregoriancalendar.obj \ qhash.obj \ qiodevice.obj \ qringbuffer.obj \ @@ -97,6 +99,7 @@ QTOBJS= \ qoperatingsystemversion.obj \ qoperatingsystemversion_win.obj \ qregexp.obj \ + qromancalendar.obj \ qutfcodec.obj \ qstring.obj \ qstringlist.obj \ diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc index b271abcee3..3495f97b2c 100644 --- a/qmake/doc/src/qmake-manual.qdoc +++ b/qmake/doc/src/qmake-manual.qdoc @@ -2583,10 +2583,8 @@ \section1 RC_FILE - Specifies the name of the resource file for the application. - The value of this variable is typically handled by - qmake or \l{#QMAKESPEC}{qmake.conf} and rarely - needs to be modified. + Windows only. Specifies the name of the Windows resource file (.rc) for the + target. See \l{Adding Windows Resource Files}. \target RC_CODEPAGE \section1 RC_CODEPAGE @@ -2649,7 +2647,9 @@ \section1 RES_FILE - Specifies the name of the compiled Windows resource file for the target. + Windows only. Specifies the name of the Windows resource compiler's output + file for this target. See \l{RC_FILE} and \l{Adding Windows Resource Files}. + The value of this variable is typically handled by qmake or \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified. diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 2082bd6dc3..94e9259c68 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -764,27 +764,13 @@ MakefileGenerator::init() ProStringList incDirs = v["DEPENDPATH"] + v["QMAKE_ABSOLUTE_SOURCE_PATH"]; if(project->isActiveConfig("depend_includepath")) incDirs += v["INCLUDEPATH"]; - QList<QMakeLocalFileName> deplist; + QVector<QMakeLocalFileName> deplist; deplist.reserve(incDirs.size()); for (ProStringList::Iterator it = incDirs.begin(); it != incDirs.end(); ++it) deplist.append(QMakeLocalFileName((*it).toQString())); QMakeSourceFileInfo::setDependencyPaths(deplist); debug_msg(1, "Dependency Directories: %s", incDirs.join(QString(" :: ")).toLatin1().constData()); - //cache info - if(project->isActiveConfig("qmake_cache")) { - QString cache_file; - if(!project->isEmpty("QMAKE_INTERNAL_CACHE_FILE")) { - cache_file = QDir::fromNativeSeparators(project->first("QMAKE_INTERNAL_CACHE_FILE").toQString()); - } else { - cache_file = ".qmake.internal.cache"; - if(project->isActiveConfig("build_pass")) - cache_file += ".BUILD." + project->first("BUILD_PASS"); - } - if(cache_file.indexOf('/') == -1) - cache_file.prepend(Option::output_dir + '/'); - QMakeSourceFileInfo::setCacheFile(cache_file); - } //add to dependency engine for(x = 0; x < compilers.count(); ++x) { @@ -1839,7 +1825,7 @@ static QStringList splitDeps(const QString &indeps, bool lineMode) QString MakefileGenerator::resolveDependency(const QDir &outDir, const QString &file) { - const QList<QMakeLocalFileName> &depdirs = QMakeSourceFileInfo::dependencyPaths(); + const QVector<QMakeLocalFileName> &depdirs = QMakeSourceFileInfo::dependencyPaths(); for (const auto &depdir : depdirs) { const QString &local = depdir.local(); QString lf = outDir.absoluteFilePath(local + '/' + file); @@ -3105,7 +3091,7 @@ MakefileGenerator::findFileForDep(const QMakeLocalFileName &dep, const QMakeLoca if(Option::output_dir != qmake_getpwd() && QDir::isRelativePath(dep.real())) { //is it from the shadow tree - QList<QMakeLocalFileName> depdirs = QMakeSourceFileInfo::dependencyPaths(); + QVector<QMakeLocalFileName> depdirs = QMakeSourceFileInfo::dependencyPaths(); depdirs.prepend(fileInfo(file.real()).absoluteDir().path()); QString pwd = qmake_getpwd(); if(pwd.at(pwd.length()-1) != '/') @@ -3456,4 +3442,13 @@ QString MakefileGenerator::shellQuote(const QString &str) return isWindowsShell() ? IoUtils::shellQuoteWin(str) : IoUtils::shellQuoteUnix(str); } +/* + * Returns the name of the variable that contains the fully resolved target + * (including DESTDIR) of this generator. + */ +ProKey MakefileGenerator::fullTargetVariable() const +{ + return "TARGET"; +} + QT_END_NAMESPACE diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h index ac1d5abb11..45250a6aa2 100644 --- a/qmake/generators/makefile.h +++ b/qmake/generators/makefile.h @@ -276,6 +276,7 @@ public: virtual bool openOutput(QFile &, const QString &build) const; bool isWindowsShell() const { return Option::dir_sep == QLatin1String("\\"); } QString shellQuote(const QString &str); + virtual ProKey fullTargetVariable() const; }; Q_DECLARE_TYPEINFO(MakefileGenerator::Compiler, Q_MOVABLE_TYPE); Q_DECLARE_OPERATORS_FOR_FLAGS(MakefileGenerator::FileFixifyTypes) diff --git a/qmake/generators/makefiledeps.cpp b/qmake/generators/makefiledeps.cpp index 69a3217723..7c4be64aa8 100644 --- a/qmake/generators/makefiledeps.cpp +++ b/qmake/generators/makefiledeps.cpp @@ -60,21 +60,14 @@ QT_BEGIN_NAMESPACE inline bool qmake_endOfLine(const char &c) { return (c == '\r' || c == '\n'); } #endif -//#define QMAKE_USE_CACHE - -QMakeLocalFileName::QMakeLocalFileName(const QString &name) : is_null(name.isNull()) +QMakeLocalFileName::QMakeLocalFileName(const QString &name) + : real_name(name) { - if(!name.isEmpty()) { - if(name.at(0) == QLatin1Char('"') && name.at(name.length()-2) == QLatin1Char('"')) - real_name = name.mid(1, name.length()-2); - else - real_name = name; - } } const QString &QMakeLocalFileName::local() const { - if(!is_null && local_name.isNull()) + if (!isNull() && local_name.isNull()) local_name = Option::normalizePath(real_name); return local_name; } @@ -199,10 +192,10 @@ void QMakeSourceFileInfo::dependTreeWalker(SourceFile *node, SourceDependChildre } } -void QMakeSourceFileInfo::setDependencyPaths(const QList<QMakeLocalFileName> &l) +void QMakeSourceFileInfo::setDependencyPaths(const QVector<QMakeLocalFileName> &l) { // Ensure that depdirs does not contain the same paths several times, to minimize the stats - QList<QMakeLocalFileName> ll; + QVector<QMakeLocalFileName> ll; for (int i = 0; i < l.count(); ++i) { if (!ll.contains(l.at(i))) ll.append(l.at(i)); @@ -265,19 +258,10 @@ QMakeSourceFileInfo::QMakeSourceFileInfo(const QString &cf) //buffer spare_buffer = nullptr; spare_buffer_size = 0; - - //cache - cachefile = cf; - if(!cachefile.isEmpty()) - loadCache(cachefile); } QMakeSourceFileInfo::~QMakeSourceFileInfo() { - //cache - if(!cachefile.isEmpty() /*&& files_changed*/) - saveCache(cachefile); - //buffer if(spare_buffer) { free(spare_buffer); @@ -290,12 +274,6 @@ QMakeSourceFileInfo::~QMakeSourceFileInfo() delete includes; } -void QMakeSourceFileInfo::setCacheFile(const QString &cf) -{ - cachefile = cf; - loadCache(cachefile); -} - void QMakeSourceFileInfo::addSourceFiles(const ProStringList &l, uchar seek, QMakeSourceFileInfo::SourceFileType type) { @@ -853,8 +831,8 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file) } } if(!exists) { //path lookup - for(QList<QMakeLocalFileName>::Iterator it = depdirs.begin(); it != depdirs.end(); ++it) { - QMakeLocalFileName f((*it).real() + Option::dir_sep + lfn.real()); + for (const QMakeLocalFileName &depdir : qAsConst(depdirs)) { + QMakeLocalFileName f(depdir.real() + Option::dir_sep + lfn.real()); QFileInfo fi(findFileInfo(f)); if(fi.exists() && !fi.isDir()) { lfn = fixPathForFile(f); @@ -1054,151 +1032,4 @@ bool QMakeSourceFileInfo::findMocs(SourceFile *file) return true; } - -void QMakeSourceFileInfo::saveCache(const QString &cf) -{ -#ifdef QMAKE_USE_CACHE - if(cf.isEmpty()) - return; - - QFile file(QMakeLocalFileName(cf).local()); - if(file.open(QIODevice::WriteOnly)) { - QTextStream stream(&file); - stream << QMAKE_VERSION_STR << endl << endl; //version - { //cache verification - QMap<QString, QStringList> verify = getCacheVerification(); - stream << verify.count() << endl; - for(QMap<QString, QStringList>::iterator it = verify.begin(); - it != verify.end(); ++it) { - stream << it.key() << endl << it.value().join(';') << endl; - } - stream << endl; - } - if(files->nodes) { - for(int file = 0; file < files->num_nodes; ++file) { - for(SourceFiles::SourceFileNode *node = files->nodes[file]; node; node = node->next) { - stream << node->file->file.local() << endl; //source - stream << node->file->type << endl; //type - - //depends - stream << ";"; - if(node->file->deps) { - for(int depend = 0; depend < node->file->deps->used_nodes; ++depend) { - if(depend) - stream << ";"; - stream << node->file->deps->children[depend]->file.local(); - } - } - stream << endl; - - stream << node->file->mocable << endl; //mocable - stream << endl; //just for human readability - } - } - } - stream.flush(); - file.close(); - } -#else - Q_UNUSED(cf); -#endif -} - -void QMakeSourceFileInfo::loadCache(const QString &cf) -{ - if(cf.isEmpty()) - return; - -#ifdef QMAKE_USE_CACHE - QMakeLocalFileName cache_file(cf); - int fd = open(QMakeLocalFileName(cf).local().toLatin1(), O_RDONLY); - if(fd == -1) - return; - QFileInfo cache_fi = findFileInfo(cache_file); - if(!cache_fi.exists() || cache_fi.isDir()) - return; - - QFile file; - if (!file.open(fd, QIODevice::ReadOnly)) - return; - QTextStream stream(&file); - - if (stream.readLine() == QMAKE_VERSION_STR) { //version check - stream.skipWhiteSpace(); - - bool verified = true; - { //cache verification - QMap<QString, QStringList> verify; - int len = stream.readLine().toInt(); - for(int i = 0; i < len; ++i) { - QString var = stream.readLine(); - QString val = stream.readLine(); - verify.insert(var, val.split(';', QString::SkipEmptyParts)); - } - verified = verifyCache(verify); - } - if(verified) { - stream.skipWhiteSpace(); - if(!files) - files = new SourceFiles; - while(!stream.atEnd()) { - QString source = stream.readLine(); - QString type = stream.readLine(); - QString depends = stream.readLine(); - QString mocable = stream.readLine(); - stream.skipWhiteSpace(); - - QMakeLocalFileName fn(source); - QFileInfo fi = findFileInfo(fn); - - SourceFile *file = files->lookupFile(fn); - if(!file) { - file = new SourceFile; - file->file = fn; - files->addFile(file); - file->type = (SourceFileType)type.toInt(); - file->exists = fi.exists(); - } - if(fi.exists() && fi.lastModified() < cache_fi.lastModified()) { - if(!file->dep_checked) { //get depends - if(!file->deps) - file->deps = new SourceDependChildren; - file->dep_checked = true; - QStringList depend_list = depends.split(";", QString::SkipEmptyParts); - for(int depend = 0; depend < depend_list.size(); ++depend) { - QMakeLocalFileName dep_fn(depend_list.at(depend)); - QFileInfo dep_fi(findFileInfo(dep_fn)); - SourceFile *dep = files->lookupFile(dep_fn); - if(!dep) { - dep = new SourceFile; - dep->file = dep_fn; - dep->exists = dep_fi.exists(); - dep->type = QMakeSourceFileInfo::TYPE_UNKNOWN; - files->addFile(dep); - } - dep->included_count++; - file->deps->addChild(dep); - } - } - if(!file->moc_checked) { //get mocs - file->moc_checked = true; - file->mocable = mocable.toInt(); - } - } - } - } - } -#endif -} - -QMap<QString, QStringList> QMakeSourceFileInfo::getCacheVerification() -{ - return QMap<QString, QStringList>(); -} - -bool QMakeSourceFileInfo::verifyCache(const QMap<QString, QStringList> &v) -{ - return v == getCacheVerification(); -} - QT_END_NAMESPACE diff --git a/qmake/generators/makefiledeps.h b/qmake/generators/makefiledeps.h index 034197fd31..7e39396754 100644 --- a/qmake/generators/makefiledeps.h +++ b/qmake/generators/makefiledeps.h @@ -33,6 +33,7 @@ #include <qstringlist.h> #include <qfileinfo.h> +#include <qvector.h> QT_BEGIN_NAMESPACE @@ -40,13 +41,14 @@ struct SourceFile; struct SourceDependChildren; class SourceFiles; -class QMakeLocalFileName { - bool is_null; - mutable QString real_name, local_name; +class QMakeLocalFileName +{ + QString real_name; + mutable QString local_name; public: - QMakeLocalFileName() : is_null(true) {} + QMakeLocalFileName() = default; QMakeLocalFileName(const QString &); - bool isNull() const { return is_null; } + bool isNull() const { return real_name.isNull(); } inline const QString &real() const { return real_name; } const QString &local() const; @@ -64,7 +66,7 @@ private: //quick project lookups SourceFiles *files, *includes; bool files_changed; - QList<QMakeLocalFileName> depdirs; + QVector<QMakeLocalFileName> depdirs; QStringList systemIncludes; //sleezy buffer code @@ -77,9 +79,6 @@ private: bool findDeps(SourceFile *); void dependTreeWalker(SourceFile *, SourceDependChildren *); - //cache - QString cachefile; - protected: virtual QMakeLocalFileName fixPathForFile(const QMakeLocalFileName &, bool forOpen=false); virtual QMakeLocalFileName findFileForDep(const QMakeLocalFileName &, const QMakeLocalFileName &); @@ -90,8 +89,8 @@ public: QMakeSourceFileInfo(const QString &cachefile=""); virtual ~QMakeSourceFileInfo(); - QList<QMakeLocalFileName> dependencyPaths() const { return depdirs; } - void setDependencyPaths(const QList<QMakeLocalFileName> &); + QVector<QMakeLocalFileName> dependencyPaths() const { return depdirs; } + void setDependencyPaths(const QVector<QMakeLocalFileName> &); enum DependencyMode { Recursive, NonRecursive }; inline void setDependencyMode(DependencyMode mode) { dep_mode = mode; } @@ -112,12 +111,6 @@ public: bool mocable(const QString &file); - virtual QMap<QString, QStringList> getCacheVerification(); - virtual bool verifyCache(const QMap<QString, QStringList> &); - void setCacheFile(const QString &cachefile); //auto caching - void loadCache(const QString &cf); - void saveCache(const QString &cf); - private: DependencyMode dep_mode; }; diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp index 705ad7008a..22a72100f7 100644 --- a/qmake/generators/metamakefile.cpp +++ b/qmake/generators/metamakefile.cpp @@ -33,6 +33,10 @@ #include "project.h" #include "cachekeys.h" +#include <algorithm> +#include <iterator> +#include <utility> + #define BUILDSMETATYPE 1 #define SUBDIRSMETATYPE 2 @@ -58,6 +62,7 @@ private: void clearBuilds(); MakefileGenerator *processBuild(const ProString &); void accumulateVariableFromBuilds(const ProKey &name, Build *build) const; + void checkForConflictingTargets() const; public: @@ -186,6 +191,7 @@ BuildsMetaMakefileGenerator::write() if(!build->makefile) { ret = false; } else if(build == glue) { + checkForConflictingTargets(); accumulateVariableFromBuilds("QMAKE_INTERNAL_INCLUDED_FILES", build); ret = build->makefile->writeProjectMakefile(); } else { @@ -239,6 +245,39 @@ void BuildsMetaMakefileGenerator::accumulateVariableFromBuilds(const ProKey &nam values.removeDuplicates(); } +void BuildsMetaMakefileGenerator::checkForConflictingTargets() const +{ + if (makefiles.count() < 3) { + // Checking for conflicts only makes sense if we have more than one BUILD, + // and the last entry in makefiles is the "glue" Build. + return; + } + using TargetInfo = std::pair<Build *, ProString>; + QVector<TargetInfo> targets; + const int last = makefiles.count() - 1; + targets.resize(last); + for (int i = 0; i < last; ++i) { + Build *b = makefiles.at(i); + auto mkf = b->makefile; + auto prj = mkf->projectFile(); + targets[i] = std::make_pair(b, prj->first(mkf->fullTargetVariable())); + } + std::stable_sort(targets.begin(), targets.end(), + [](const TargetInfo &lhs, const TargetInfo &rhs) + { + return lhs.second < rhs.second; + }); + for (auto prev = targets.begin(), it = std::next(prev); it != targets.end(); ++prev, ++it) { + if (prev->second == it->second) { + warn_msg(WarnLogic, "Targets of builds '%s' and '%s' conflict: %s.", + qPrintable(prev->first->build), + qPrintable(it->first->build), + qPrintable(prev->second.toQString())); + break; + } + } +} + class SubdirsMetaMakefileGenerator : public MetaMakefileGenerator { protected: diff --git a/qmake/generators/projectgenerator.cpp b/qmake/generators/projectgenerator.cpp index 119dd652b3..c43f6b4e4a 100644 --- a/qmake/generators/projectgenerator.cpp +++ b/qmake/generators/projectgenerator.cpp @@ -215,7 +215,7 @@ ProjectGenerator::init() } //setup deplist - QList<QMakeLocalFileName> deplist; + QVector<QMakeLocalFileName> deplist; { const ProStringList &d = v["DEPENDPATH"]; for(int i = 0; i < d.size(); ++i) diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index 227dc8908a..664c81296c 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -392,7 +392,7 @@ UnixMakefileGenerator::fixLibFlag(const ProString &lib) bool UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags) { - QList<QMakeLocalFileName> libdirs, frameworkdirs; + QVector<QMakeLocalFileName> libdirs, frameworkdirs; int libidx = 0, fwidx = 0; for (const ProString &dlib : project->values("QMAKE_DEFAULT_LIBDIRS")) libdirs.append(QMakeLocalFileName(dlib.toQString())); @@ -418,9 +418,8 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags) libdirs.insert(libidx++, f); } else if(opt.startsWith("-l")) { QString lib = opt.mid(2); - for (QList<QMakeLocalFileName>::Iterator dep_it = libdirs.begin(); - dep_it != libdirs.end(); ++dep_it) { - QString libBase = (*dep_it).local() + '/' + for (const QMakeLocalFileName &libdir : qAsConst(libdirs)) { + QString libBase = libdir.local() + '/' + project->first("QMAKE_PREFIX_SHLIB") + lib; if (linkPrl && processPrlFile(libBase, true)) goto found; diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 8d1bd08197..8b4f2bf58f 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -1447,7 +1447,36 @@ UnixMakefileGenerator::libtoolFileName(bool fixify) void UnixMakefileGenerator::writeLibtoolFile() { + auto fixDependencyLibs + = [this](const ProStringList &libs) + { + ProStringList result; + for (auto lib : libs) { + auto fi = fileInfo(lib.toQString()); + if (fi.isAbsolute()) { + const QString libDirArg = "-L" + fi.path(); + if (!result.contains(libDirArg)) + result += libDirArg; + QString namespec = fi.fileName(); + int dotPos = namespec.lastIndexOf('.'); + if (dotPos != -1 && namespec.startsWith("lib")) { + namespec.truncate(dotPos); + namespec.remove(0, 3); + } else { + debug_msg(1, "Ignoring dependency library %s", + lib.toLatin1().constData()); + continue; + } + result += "-l" + namespec; + } else { + result += lib; + } + } + return result; + }; + QString fname = libtoolFileName(), lname = fname; + debug_msg(1, "Writing libtool file %s", fname.toLatin1().constData()); mkdir(fileInfo(fname).path()); int slsh = lname.lastIndexOf(Option::dir_sep); if(slsh != -1) @@ -1485,12 +1514,11 @@ UnixMakefileGenerator::writeLibtoolFile() << ".a'\n\n"; t << "# Libraries that this one depends upon.\n"; + static const ProKey libVars[] = { "LIBS", "QMAKE_LIBS" }; ProStringList libs; - libs << "LIBS" << "QMAKE_LIBS"; - t << "dependency_libs='"; - for (ProStringList::ConstIterator it = libs.cbegin(); it != libs.cend(); ++it) - t << fixLibFlags((*it).toKey()).join(' ') << ' '; - t << "'\n\n"; + for (auto var : libVars) + libs += fixLibFlags(var); + t << "dependency_libs='" << fixDependencyLibs(libs).join(' ') << "'\n\n"; t << "# Version information for " << lname << "\n"; int maj = project->first("VER_MAJ").toInt(); diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp index 40114948c2..878291fae9 100644 --- a/qmake/generators/win32/mingw_make.cpp +++ b/qmake/generators/win32/mingw_make.cpp @@ -342,7 +342,11 @@ void MingwMakefileGenerator::writeRcFilePart(QTextStream &t) if (defines.isEmpty()) defines = ProString(" $(DEFINES)"); - t << escapeDependencyPath(var("RES_FILE")) << ": " << escapeDependencyPath(rc_file) << "\n\t" + addSourceFile(rc_file, QMakeSourceFileInfo::SEEK_DEPS); + const QStringList rcDeps = QStringList(rc_file) << dependencies(rc_file); + + t << escapeDependencyPath(var("RES_FILE")) << ": " + << escapeDependencyPaths(rcDeps).join(' ') << "\n\t" << var("QMAKE_RC") << " -i " << escapeFilePath(rc_file) << " -o " << fileVar("RES_FILE") << incPathStr << defines << "\n\n"; } diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp index 3116238aa0..0515c7404f 100644 --- a/qmake/generators/win32/msbuild_objectmodel.cpp +++ b/qmake/generators/win32/msbuild_objectmodel.cpp @@ -300,14 +300,17 @@ inline XmlOutput::xml_output valueTagT( const triState v) return valueTag(v == _True ? "true" : "false"); } -static QString vcxCommandSeparator() +static QString commandLinesForOutput(QStringList commands) { // MSBuild puts the contents of the custom commands into a batch file and calls it. // As we want every sub-command to be error-checked (as is done by makefile-based // backends), we insert the checks ourselves, using the undocumented jump target. - static QString cmdSep = - QLatin1String("
if errorlevel 1 goto VCEnd
"); - return cmdSep; + static QString errchk = QStringLiteral("if errorlevel 1 goto VCEnd"); + for (int i = commands.count() - 2; i >= 0; --i) { + if (!commands.at(i).startsWith("rem", Qt::CaseInsensitive)) + commands.insert(i + 1, errchk); + } + return commands.join('\n'); } static QString unquote(const QString &value) @@ -1658,7 +1661,7 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCCustomBuildTool &tool) { xml << tag("Command") << attrTag("Condition", condition) - << valueTag(tool.CommandLine.join(vcxCommandSeparator())); + << valueTag(commandLinesForOutput(tool.CommandLine)); } if ( !tool.Description.isEmpty() ) @@ -1712,7 +1715,7 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCEventTool &tool) { xml << tag(tool.EventName) - << tag(_Command) << valueTag(tool.CommandLine.join(vcxCommandSeparator())) + << tag(_Command) << valueTag(commandLinesForOutput(tool.CommandLine)) << tag(_Message) << valueTag(tool.Description) << closetag(tool.EventName); } diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index b6f7f20564..b74448ce94 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -209,7 +209,9 @@ bool VcprojGenerator::writeProjectMakefile() struct VcsolutionDepend { QString uuid; - QString vcprojFile, orig_target, target; + QString vcprojFile; + QString projectName; + QString target; Target targetType; QStringList dependencies; }; @@ -433,7 +435,8 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt Option::qmake_mode = old_mode; // We assume project filename is [QMAKE_PROJECT_NAME].vcproj - QString vcproj = tmp_vcproj.project->first("QMAKE_PROJECT_NAME") + project->first("VCPROJ_EXTENSION"); + const ProString projectName = tmp_vcproj.project->first("QMAKE_PROJECT_NAME"); + const QString vcproj = projectName + project->first("VCPROJ_EXTENSION"); QString vcprojDir = Option::output_dir; // If file doesn't exsist, then maybe the users configuration @@ -445,14 +448,14 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt VcsolutionDepend *newDep = new VcsolutionDepend; newDep->vcprojFile = vcprojDir + Option::dir_sep + vcproj; - newDep->orig_target = tmp_proj.first("QMAKE_ORIG_TARGET").toQString(); + newDep->projectName = projectName.toQString(); newDep->target = tmp_proj.first("MSVCPROJ_TARGET").toQString().section(Option::dir_sep, -1); newDep->targetType = tmp_vcproj.projectTarget; newDep->uuid = tmp_proj.isEmpty("QMAKE_UUID") ? getProjectUUID(Option::fixPathToLocalOS(vcprojDir + QDir::separator() + vcproj)).toString().toUpper(): tmp_proj.first("QMAKE_UUID").toQString(); // We want to store it as the .lib name. if (newDep->target.endsWith(".dll")) newDep->target = newDep->target.left(newDep->target.length()-3) + "lib"; - projGuids.insert(newDep->orig_target, newDep->target); + projGuids.insert(newDep->projectName, newDep->target); if (tmpList.size()) { const ProStringList depends = tmpList; @@ -591,7 +594,7 @@ void VcprojGenerator::writeSubDirs(QTextStream &t) for (QList<VcsolutionDepend*>::Iterator it = solution_cleanup.begin(); it != solution_cleanup.end(); ++it) { // ### quoting rules? t << _slnProjectBeg << _slnMSVCvcprojGUID << _slnProjectMid - << "\"" << (*it)->orig_target << "\", \"" << (*it)->vcprojFile + << "\"" << (*it)->projectName << "\", \"" << (*it)->vcprojFile << "\", \"" << (*it)->uuid << "\""; debug_msg(1, "Project %s has dependencies: %s", (*it)->target.toLatin1().constData(), (*it)->dependencies.join(" ").toLatin1().constData()); @@ -937,6 +940,15 @@ void VcprojGenerator::initProject() vcProject.SccProjectName = project->first("SCCPROJECTNAME").toQString(); vcProject.SccLocalPath = project->first("SCCLOCALPATH").toQString(); vcProject.flat_files = project->isActiveConfig("flat"); + + // Set up the full target path for target conflict checking. + const QChar slash = QLatin1Char('/'); + QString destdir = QDir::fromNativeSeparators(var("DESTDIR")); + if (!destdir.endsWith(slash)) + destdir.append(slash); + project->values("DEST_TARGET") = ProStringList(destdir + + project->first("TARGET") + + project->first("TARGET_EXT")); } void VcprojGenerator::initConfiguration() diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index b79fd8f250..27d2a7c0a5 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -79,7 +79,7 @@ Win32MakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags) ProStringList impexts = project->values("QMAKE_LIB_EXTENSIONS"); if (impexts.isEmpty()) impexts = project->values("QMAKE_EXTENSION_STATICLIB"); - QList<QMakeLocalFileName> dirs; + QVector<QMakeLocalFileName> dirs; int libidx = 0; for (const ProString &dlib : project->values("QMAKE_DEFAULT_LIBDIRS")) dirs.append(QMakeLocalFileName(dlib.toQString())); @@ -104,8 +104,7 @@ Win32MakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags) QString lib = arg.toQString(); ProString verovr = project->first(ProKey("QMAKE_" + lib.toUpper() + "_VERSION_OVERRIDE")); - for (QList<QMakeLocalFileName>::Iterator dir_it = dirs.begin(); - dir_it != dirs.end(); ++dir_it) { + for (auto dir_it = dirs.begin(); dir_it != dirs.end(); ++dir_it) { QString cand = (*dir_it).real() + Option::dir_sep + lib; if (linkPrl && processPrlFile(cand, true)) { (*it) = cand; @@ -128,8 +127,7 @@ Win32MakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags) if (processPrlFile(lib, false)) (*it) = lib; } else { - for (QList<QMakeLocalFileName>::Iterator dir_it = dirs.begin(); - dir_it != dirs.end(); ++dir_it) { + for (auto dir_it = dirs.begin(); dir_it != dirs.end(); ++dir_it) { QString cand = (*dir_it).real() + Option::dir_sep + lib; if (processPrlFile(cand, false)) { (*it) = cand; @@ -669,6 +667,9 @@ void Win32MakefileGenerator::writeRcFilePart(QTextStream &t) incPathStr += escapeFilePath(path); } + addSourceFile(rc_file, QMakeSourceFileInfo::SEEK_DEPS); + const QStringList rcDeps = QStringList(rc_file) << dependencies(rc_file); + // The resource tool may use defines. This might be the same defines passed in as the // compiler, since you may use these defines in the .rc file itself. // As the escape syntax for the command line defines for RC is different from that for CL, @@ -680,7 +681,8 @@ void Win32MakefileGenerator::writeRcFilePart(QTextStream &t) // Also, we need to add the _DEBUG define manually since the compiler defines this symbol // by itself, and we use it in the automatically created rc file when VERSION is defined // in the .pro file. - t << escapeDependencyPath(res_file) << ": " << escapeDependencyPath(rc_file) << "\n\t" + t << escapeDependencyPath(res_file) << ": " + << escapeDependencyPaths(rcDeps).join(' ') << "\n\t" << var("QMAKE_RC") << (project->isActiveConfig("debug") ? " -D_DEBUG" : "") << defines << incPathStr << " -fo " << escapeFilePath(res_file) << ' ' << escapeFilePath(rc_file); @@ -815,4 +817,9 @@ QString Win32MakefileGenerator::getManifestFileForRcFile() const return QString(); } +ProKey Win32MakefileGenerator::fullTargetVariable() const +{ + return "DEST_TARGET"; +} + QT_END_NAMESPACE diff --git a/qmake/generators/win32/winmakefile.h b/qmake/generators/win32/winmakefile.h index 8eb633fdfa..09984fe355 100644 --- a/qmake/generators/win32/winmakefile.h +++ b/qmake/generators/win32/winmakefile.h @@ -64,6 +64,9 @@ protected: void processRcFileVar(); static QString cQuoted(const QString &str); virtual QString getManifestFileForRcFile() const; + +public: + ProKey fullTargetVariable() const override; }; QT_END_NAMESPACE diff --git a/qmake/generators/xmloutput.cpp b/qmake/generators/xmloutput.cpp index 2f48763550..7fc1b081c7 100644 --- a/qmake/generators/xmloutput.cpp +++ b/qmake/generators/xmloutput.cpp @@ -113,7 +113,8 @@ QString XmlOutput::doConversion(const QString &text) // this is a way to escape characters that shouldn't be converted for (int i=0; i<text.count(); ++i) { - if (text.at(i) == QLatin1Char('&')) { + const QChar c = text.at(i); + if (c == QLatin1Char('&')) { if ( (i + 7) < text.count() && text.at(i + 1) == QLatin1Char('#') && text.at(i + 2) == QLatin1Char('x') && @@ -122,12 +123,15 @@ QString XmlOutput::doConversion(const QString &text) } else { output += QLatin1String("&"); } + } else if (c == QLatin1Char('<')) { + output += QLatin1String("<"); + } else if (c == QLatin1Char('>')) { + output += QLatin1String(">"); } else { - QChar c = text.at(i); if (c.unicode() < 0x20) { output += QString("&#x%1;").arg(c.unicode(), 2, 16, QLatin1Char('0')); } else { - output += text.at(i); + output += c; } } } diff --git a/qmake/qmake.pro b/qmake/qmake.pro index 4681fbf764..a9d8b58da8 100644 --- a/qmake/qmake.pro +++ b/qmake/qmake.pro @@ -115,6 +115,7 @@ SOURCES += \ qbuffer.cpp \ qbytearray.cpp \ qbytearraymatcher.cpp \ + qcalendar.cpp \ qcryptographichash.cpp \ qdatetime.cpp \ qdir.cpp \ @@ -127,6 +128,7 @@ SOURCES += \ qfsfileengine.cpp \ qfsfileengine_iterator.cpp \ qglobal.cpp \ + qgregoriancalendar.cpp \ qhash.cpp \ qiodevice.cpp \ qjson.cpp \ @@ -145,6 +147,7 @@ SOURCES += \ qmetatype.cpp \ qnumeric.cpp \ qregexp.cpp \ + qromancalendar.cpp \ qsettings.cpp \ qstring.cpp \ qstringlist.cpp \ @@ -168,6 +171,9 @@ HEADERS += \ qbuffer.h \ qbytearray.h \ qbytearraymatcher.h \ + qcalendar.h \ + qcalendarbackend_p.h \ + qcalendarmath_p.h \ qchar.h \ qcryptographichash.h \ qdatetime.h \ @@ -178,6 +184,7 @@ HEADERS += \ qfile.h \ qfileinfo.h \ qglobal.h \ + qgregoriancalendar_p.h \ qhash.h \ qiodevice.h \ qjson_p.h \ @@ -194,6 +201,7 @@ HEADERS += \ qmetatype.h \ qnumeric.h \ qregexp.h \ + qromancalendar_p.h \ qstring.h \ qstringlist.h \ qstringmatcher.h \ |