diff options
author | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2014-11-20 16:20:16 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2015-02-17 18:27:25 +0000 |
commit | c0d67bb5c9370408ca68f21925de5ec9e89ad9cb (patch) | |
tree | 59b182b2e1f028a2f39a08c5a45aabfb5883ecb4 /qmake/generators/makefile.h | |
parent | 6ccf0a326ef415b7c9c8d80e9ede0da85e2fb52b (diff) |
fix filename handling in replaceExtraCompilerVariables()
fixing and escaping is now a tri-state option:
- none (this removes the need to unescape the result right afterwards in
some cases)
- local shell (for system())
- target shell (for Makefile)
Change-Id: I5b78d9b70630fe4484dc964eff5f62793da35764
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'qmake/generators/makefile.h')
-rw-r--r-- | qmake/generators/makefile.h | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h index 2753a15e1c..972127916c 100644 --- a/qmake/generators/makefile.h +++ b/qmake/generators/makefile.h @@ -52,20 +52,6 @@ QT_BEGIN_NAMESPACE #define QT_PCLOSE pclose #endif -struct ReplaceExtraCompilerCacheKey -{ - mutable uint hash; - QString var, in, out, pwd; - ReplaceExtraCompilerCacheKey(const QString &v, const QStringList &i, const QStringList &o); - bool operator==(const ReplaceExtraCompilerCacheKey &f) const; - inline uint hashCode() const { - if(!hash) - hash = qHash(var) ^ qHash(in) ^ qHash(out) /*^ qHash(pwd)*/; - return hash; - } -}; -inline uint qHash(const ReplaceExtraCompilerCacheKey &f) { return f.hashCode(); } - struct ReplaceExtraCompilerCacheKey; class MakefileGenerator : protected QMakeSourceFileInfo @@ -81,6 +67,10 @@ class MakefileGenerator : protected QMakeSourceFileInfo mutable QHash<QString, QStringList> dependsCache; mutable QHash<ReplaceExtraCompilerCacheKey, QString> extraCompilerVariablesCache; +public: + // We can't make it visible to VCFilter in VS2008 except by making it public or directly friending it. + enum ReplaceFor { NoShell, LocalShell, TargetShell }; + protected: enum TARG_MODE { TARG_UNIX_MODE, TARG_MAC_MODE, TARG_WIN_MODE } target_mode; @@ -132,9 +122,9 @@ protected: //extra compiler interface bool verifyExtraCompiler(const ProString &c, const QString &f); - virtual QString replaceExtraCompilerVariables(const QString &, const QStringList &, const QStringList &); - inline QString replaceExtraCompilerVariables(const QString &val, const QString &in, const QString &out) - { return replaceExtraCompilerVariables(val, QStringList(in), QStringList(out)); } + virtual QString replaceExtraCompilerVariables(const QString &, const QStringList &, const QStringList &, ReplaceFor forShell); + inline QString replaceExtraCompilerVariables(const QString &val, const QString &in, const QString &out, ReplaceFor forShell) + { return replaceExtraCompilerVariables(val, QStringList(in), QStringList(out), forShell); } //interface to the source file info QMakeLocalFileName fixPathForFile(const QMakeLocalFileName &, bool); @@ -281,6 +271,21 @@ inline bool MakefileGenerator::findLibraries() inline MakefileGenerator::~MakefileGenerator() { } +struct ReplaceExtraCompilerCacheKey +{ + mutable uint hash; + QString var, in, out, pwd; + MakefileGenerator::ReplaceFor forShell; + ReplaceExtraCompilerCacheKey(const QString &v, const QStringList &i, const QStringList &o, MakefileGenerator::ReplaceFor s); + bool operator==(const ReplaceExtraCompilerCacheKey &f) const; + inline uint hashCode() const { + if (!hash) + hash = (uint)forShell ^ qHash(var) ^ qHash(in) ^ qHash(out) /*^ qHash(pwd)*/; + return hash; + } +}; +inline uint qHash(const ReplaceExtraCompilerCacheKey &f) { return f.hashCode(); } + QT_END_NAMESPACE #endif // MAKEFILE_H |