diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-07-12 12:52:22 +0200 |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-07-12 12:52:22 +0200 |
commit | 2371147354d4436bb54c588662ac315dd4c2f940 (patch) | |
tree | 5c90b1dd18de394cff2fb4e1bedc628da3c7d341 /qmake | |
parent | 54ec6d177e0e8fb04cd01e70461484a80ca1f7a4 (diff) | |
parent | 82454b6014a7ee0b048b4db8d64a21de849d4ab9 (diff) |
Merge remote branch 'gerrit/master' into refactor
Conflicts:
src/gui/image/qicon.cpp
src/gui/image/qicon.h
src/gui/image/qicon_p.h
src/gui/text/qfontdatabase.cpp
src/plugins/platforms/wayland/gl_integration/qwaylandglwindowsurface.cpp
src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.cpp
src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglwindow.cpp
sync.profile
Change-Id: Ie0a23a12177ff51bf562e15b2dd41f071afb19b4
Diffstat (limited to 'qmake')
-rw-r--r-- | qmake/option.h | 1 | ||||
-rw-r--r-- | qmake/project.cpp | 78 | ||||
-rw-r--r-- | qmake/project.h | 1 | ||||
-rw-r--r-- | qmake/property.cpp | 2 | ||||
-rw-r--r-- | qmake/qmake.pri | 2 | ||||
-rw-r--r-- | qmake/qmake.pro | 1 |
6 files changed, 46 insertions, 39 deletions
diff --git a/qmake/option.h b/qmake/option.h index 83e9687cba..73a3e807aa 100644 --- a/qmake/option.h +++ b/qmake/option.h @@ -219,7 +219,6 @@ public: DataPath, TranslationsPath, SettingsPath, - DemosPath, ExamplesPath, ImportsPath }; diff --git a/qmake/project.cpp b/qmake/project.cpp index 99aa0d3ae2..ff5957765a 100644 --- a/qmake/project.cpp +++ b/qmake/project.cpp @@ -81,7 +81,7 @@ enum ExpandFunc { E_MEMBER=1, E_FIRST, E_LAST, E_CAT, E_FROMFILE, E_EVAL, E_LIST E_SPRINTF, E_JOIN, E_SPLIT, E_BASENAME, E_DIRNAME, E_SECTION, E_FIND, E_SYSTEM, E_UNIQUE, E_QUOTE, E_ESCAPE_EXPAND, E_UPPER, E_LOWER, E_FILES, E_PROMPT, E_RE_ESCAPE, E_REPLACE, - E_SIZE, E_GENERATE_UID, E_RESOLVE_DEPENDS }; + E_SIZE, E_GENERATE_UID, E_SORT_DEPENDS, E_RESOLVE_DEPENDS }; QMap<QString, ExpandFunc> qmake_expandFunctions() { static QMap<QString, ExpandFunc> *qmake_expand_functions = 0; @@ -114,6 +114,7 @@ QMap<QString, ExpandFunc> qmake_expandFunctions() qmake_expand_functions->insert("replace", E_REPLACE); qmake_expand_functions->insert("size", E_SIZE); qmake_expand_functions->insert("generate_uid", E_GENERATE_UID); + qmake_expand_functions->insert("sort_depends", E_SORT_DEPENDS); qmake_expand_functions->insert("resolve_depends", E_RESOLVE_DEPENDS); } return *qmake_expand_functions; @@ -1801,37 +1802,25 @@ QMakeProject::doProjectExpand(QString func, QStringList args, // defined in symbian generator extern QString generate_test_uid(const QString& target); - -void calculateDeps(QStringList &sortedList, const QString &item, const QString &prefix, - QStringList &org, QMap<QString, QStringList> &place) -{ - if (sortedList.contains(item)) - return; - - foreach(QString dep, place.value(prefix + item + ".depends")) { - calculateDeps(sortedList, dep, prefix, org, place); - if (org.isEmpty()) - break; - } - - if (org.contains(item)) { - sortedList += item; - org.removeAll(item); - } -} - -QStringList -QMakeProject::resolveDepends(const QStringList &deps, const QString &prefix, - QMap<QString, QStringList> &place) +static void +populateDeps(const QStringList &deps, const QString &prefix, + QHash<QString, QSet<QString> > &dependencies, QHash<QString, QStringList> &dependees, + QStringList &rootSet, QMap<QString, QStringList> &place) { - QStringList sortedList; - QStringList org = deps; - foreach(QString item, deps) { - calculateDeps(sortedList, item, prefix, org, place); - if (org.isEmpty()) - break; - } - return sortedList; + foreach (const QString &item, deps) + if (!dependencies.contains(item)) { + QSet<QString> &dset = dependencies[item]; // Always create entry + QStringList depends = place.value(prefix + item + ".depends"); + if (depends.isEmpty()) { + rootSet << item; + } else { + foreach (const QString &dep, depends) { + dset.insert(dep); + dependees[dep] << item; + } + populateDeps(depends, prefix, dependencies, dependees, rootSet, place); + } + } } QStringList @@ -2280,14 +2269,31 @@ QMakeProject::doProjectExpand(QString func, QList<QStringList> args_list, ret += generate_test_uid(args.first()); } break; + case E_SORT_DEPENDS: case E_RESOLVE_DEPENDS: { if(args.count() < 1 || args.count() > 2) { - fprintf(stderr, "%s:%d: resolve_depends(var, prefix) requires one or two arguments.\n", - parser.file.toLatin1().constData(), parser.line_no); + fprintf(stderr, "%s:%d: %s(var, prefix) requires one or two arguments.\n", + parser.file.toLatin1().constData(), parser.line_no, func.toLatin1().constData()); } else { - ret += resolveDepends(args[0].split(QString(Option::field_sep)), - (args.count() != 2 ? QString() : args[1]), - place); + QHash<QString, QSet<QString> > dependencies; + QHash<QString, QStringList> dependees; + QStringList rootSet; + + QStringList orgList = values(args[0], place); + populateDeps(orgList, (args.count() != 2 ? QString() : args[1]), + dependencies, dependees, rootSet, place); + + for (int i = 0; i < rootSet.size(); ++i) { + const QString &item = rootSet.at(i); + if ((func_t == E_RESOLVE_DEPENDS) || orgList.contains(item)) + ret.prepend(item); + foreach (const QString &dep, dependees[item]) { + QSet<QString> &dset = dependencies[dep]; + dset.remove(item); + if (dset.isEmpty()) + rootSet << dep; + } + } } break; } default: { diff --git a/qmake/project.h b/qmake/project.h index ec5e8930a4..68110a8448 100644 --- a/qmake/project.h +++ b/qmake/project.h @@ -107,7 +107,6 @@ class QMakeProject QStringList doVariableReplaceExpand(const QString &str, QMap<QString, QStringList> &place, bool *ok=0); void init(QMakeProperty *, const QMap<QString, QStringList> *); QStringList &values(const QString &v, QMap<QString, QStringList> &place); - QStringList resolveDepends(const QStringList &deps, const QString &prefix, QMap<QString, QStringList> &place); void validateModes(); public: diff --git a/qmake/property.cpp b/qmake/property.cpp index 33e5fa5c0a..24312287a4 100644 --- a/qmake/property.cpp +++ b/qmake/property.cpp @@ -104,7 +104,7 @@ QMakeProperty::value(QString v, bool just_check) else if(v == "QT_INSTALL_EXAMPLES") return QLibraryInfo::location(QLibraryInfo::ExamplesPath); else if(v == "QT_INSTALL_DEMOS") - return QLibraryInfo::location(QLibraryInfo::DemosPath); + return QLibraryInfo::location(QLibraryInfo::ExamplesPath); else if(v == "QMAKE_MKSPECS") return qmake_mkspec_paths().join(Option::dirlist_sep); else if(v == "QMAKE_VERSION") diff --git a/qmake/qmake.pri b/qmake/qmake.pri index 548ac546b9..12a1911981 100644 --- a/qmake/qmake.pri +++ b/qmake/qmake.pri @@ -68,6 +68,7 @@ bootstrap { #Qt code qlist.cpp \ qlinkedlist.cpp \ qlocale.cpp \ + qlocale_tools.cpp \ qmalloc.cpp \ qmap.cpp \ qmetatype.cpp \ @@ -111,6 +112,7 @@ bootstrap { #Qt code qlist.h \ qlinkedlist.h \ qlocale.h \ + qlocale_tools_p.h \ qmalloc.h \ qmap.h \ qmetatype.h \ diff --git a/qmake/qmake.pro b/qmake/qmake.pro index ac52bd8dd0..6c7d0d2f19 100644 --- a/qmake/qmake.pro +++ b/qmake/qmake.pro @@ -25,6 +25,7 @@ INCLUDEPATH += . \ generators/win32 \ generators/mac \ generators/symbian \ + generators/integrity \ $$QT_SOURCE_TREE/include \ $$QT_SOURCE_TREE/include/QtCore \ $$QT_SOURCE_TREE/include/QtCore/$$QT_VERSION \ |