diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-11-26 10:51:33 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-11-26 10:51:34 +0100 |
commit | 3061dc4abdfbd1a536918935d380872de6655521 (patch) | |
tree | ff440ed0c7d5816cc7e2874f73fdabfb0bce493f /qmake | |
parent | 25b2b682d616dd52c3515f443e3d25fc0224f3a2 (diff) | |
parent | 9b8570c4e9359eb8b45b39c28aa9d8c140f3fc44 (diff) |
Merge remote-tracking branch 'origin/release' into stable
Change-Id: I83ff8f4d7dffd7385013a1bd8a1732a89ee20d56
Diffstat (limited to 'qmake')
-rw-r--r-- | qmake/generators/makefile.cpp | 14 | ||||
-rw-r--r-- | qmake/generators/makefile.h | 1 | ||||
-rw-r--r-- | qmake/generators/unix/unixmake2.cpp | 10 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_nmake.cpp | 6 | ||||
-rw-r--r-- | qmake/main.cpp | 3 |
5 files changed, 24 insertions, 10 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 3093c834cc..d88c6e447a 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -43,6 +43,9 @@ #include "option.h" #include "cachekeys.h" #include "meta.h" + +#include <ioutils.h> + #include <qdir.h> #include <qfile.h> #include <qtextstream.h> @@ -52,6 +55,7 @@ #include <qbuffer.h> #include <qsettings.h> #include <qdatetime.h> + #if defined(Q_OS_UNIX) #include <unistd.h> #else @@ -92,7 +96,7 @@ bool MakefileGenerator::canExecute(const QStringList &cmdline, int *a) const QString MakefileGenerator::mkdir_p_asstring(const QString &dir, bool escape) const { - QString edir = escape ? escapeFilePath(dir) : dir; + QString edir = escape ? escapeFilePath(Option::fixPathToTargetOS(dir, false, false)) : dir; return "@" + makedir.arg(edir); } @@ -3345,11 +3349,17 @@ QString MakefileGenerator::installMetaFile(const ProKey &replace_rule, const QSt const ProString match = project->first(ProKey(replace_rules.at(r) + ".match")), replace = project->first(ProKey(replace_rules.at(r) + ".replace")); if (!match.isEmpty() /*&& match != replace*/) - ret += " -e \"s," + match + "," + replace + ",g\""; + ret += " -e " + shellQuote("s," + match + "," + replace + ",g"); } ret += " \"" + src + "\" >\"" + dst + "\""; } return ret; } +QString MakefileGenerator::shellQuote(const QString &str) +{ + return isWindowsShell() ? QMakeInternal::IoUtils::shellQuoteWin(str) + : QMakeInternal::IoUtils::shellQuoteUnix(str); +} + QT_END_NAMESPACE diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h index 09327c599c..4b8a96c15f 100644 --- a/qmake/generators/makefile.h +++ b/qmake/generators/makefile.h @@ -271,6 +271,7 @@ public: virtual bool mergeBuildProject(MakefileGenerator * /*other*/) { return false; } virtual bool openOutput(QFile &, const QString &build) const; bool isWindowsShell() const { return Option::dir_sep == QLatin1String("\\"); } + QString shellQuote(const QString &str); }; inline void MakefileGenerator::setNoIO(bool o) diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index bea01aaf80..35639a33bf 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -502,7 +502,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) incr_lflags += var("QMAKE_LFLAGS_RELEASE"); t << incr_target_dir << ": $(INCREMENTAL_OBJECTS)\n\t"; if(!destdir.isEmpty()) - t << mkdir_p_asstring(destdir) << "\n\t"; + t << mkdir_p_asstring(destdir, false) << "\n\t"; t << "$(LINK) " << incr_lflags << " " << var("QMAKE_LINK_O_FLAG") << incr_target_dir << " $(INCREMENTAL_OBJECTS)\n"; //communicated below @@ -528,7 +528,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) << " " << var("POST_TARGETDEPS"); } if(!destdir.isEmpty()) - t << "\n\t" << mkdir_p_asstring(destdir); + t << "\n\t" << mkdir_p_asstring(destdir, false); if(!project->isEmpty("QMAKE_PRE_LINK")) t << "\n\t" << var("QMAKE_PRE_LINK"); @@ -685,7 +685,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) if(!project->first("QMAKE_PKGINFO").isEmpty()) { ProString pkginfo = escapeFilePath(project->first("QMAKE_PKGINFO")); - QString destdir = escapeFilePath(project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/Contents"); + QString destdir = project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/Contents"; t << pkginfo << ": \n\t"; if(!destdir.isEmpty()) t << mkdir_p_asstring(destdir) << "\n\t"; @@ -697,7 +697,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) if(!project->first("QMAKE_BUNDLE_RESOURCE_FILE").isEmpty()) { ProString resources = escapeFilePath(project->first("QMAKE_BUNDLE_RESOURCE_FILE")); bundledFiles << resources; - QString destdir = escapeFilePath(project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/Contents/Resources"); + QString destdir = project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/Contents/Resources"; t << resources << ": \n\t"; t << mkdir_p_asstring(destdir) << "\n\t"; t << "@touch " << resources << "\n\t\n"; @@ -710,7 +710,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) QString destdir = info_plist_out.section(Option::dir_sep, 0, -2); t << info_plist_out << ": \n\t"; if(!destdir.isEmpty()) - t << mkdir_p_asstring(destdir) << "\n\t"; + t << mkdir_p_asstring(destdir, false) << "\n\t"; ProStringList commonSedArgs; if (!project->values("VERSION").isEmpty()) commonSedArgs << "-e \"s,@SHORT_VERSION@," << project->first("VER_MAJ") << "." << project->first("VER_MIN") << ",g\" "; diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index 37ba3a66ef..723f2a03e9 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -235,8 +235,10 @@ QString NmakeMakefileGenerator::defaultInstall(const QString &t) if(targetdir.right(1) != Option::dir_sep) targetdir += Option::dir_sep; - if(t == "target" && project->first("TEMPLATE") == "lib") { - if(project->isActiveConfig("shared") && project->isActiveConfig("debug")) { + if (project->isActiveConfig("debug")) { + if (t == "dlltarget" + || (project->first("TEMPLATE") == "lib" + && project->isActiveConfig("shared"))) { QString pdb_target = getPdbTarget(); pdb_target.remove('"'); QString src_targ = (project->isEmpty("DESTDIR") ? QString("$(DESTDIR)") : project->first("DESTDIR")) + pdb_target; diff --git a/qmake/main.cpp b/qmake/main.cpp index b1929e0d21..79e3739f56 100644 --- a/qmake/main.cpp +++ b/qmake/main.cpp @@ -106,7 +106,7 @@ static int doSed(int argc, char **argv) } } if (phase == 1 - && (c == QLatin1Char('+') || c == QLatin1Char('?') + && (c == QLatin1Char('+') || c == QLatin1Char('?') || c == QLatin1Char('|') || c == QLatin1Char('{') || c == QLatin1Char('}') || c == QLatin1Char('(') || c == QLatin1Char(')'))) { // translate sed rx to QRegExp @@ -133,6 +133,7 @@ static int doSed(int argc, char **argv) SedSubst subst; subst.from = QRegExp(phases.at(0)); subst.to = phases.at(1); + subst.to.replace("\\\\", "\\"); // QString::replace(rx, sub) groks \1, but not \\. substs << subst; } } else if (argv[i][0] == '-' && argv[i][1] != 0) { |