diff options
author | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2018-06-08 21:18:11 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2018-06-25 13:35:20 +0000 |
commit | 7c34e0a7b48572be1f9e3fb45911a13b01798e37 (patch) | |
tree | df66f4c8e7c7c3e924c20a5582343a44e15ea105 /qmake/generators/win32/winmakefile.cpp | |
parent | 8e075dac8f08039957fc89d48042c8810d6ae63b (diff) | |
download | qtbase-7c34e0a7b48572be1f9e3fb45911a13b01798e37.tar.gz |
qmake: escape colons and hashmarks in dependency paths
these characters can appear in file names, but are meta characters in
dependency context. they have different semantics in make commands, so
this required some reshuffling in the windows generator (which just
treated dependencies and commands the same way).
we don't actually escape colons for nmake, because it has magic
treatment of drive letters anyway (and colons cannot appear elsewhere).
also, if a target's filename gets quoted, batch rules will blow up.
therefore, "funny" file names are really only supported as inputs -
which is just enough to make resource embedding work.
Task-number: QTBUG-22863
Task-number: QTBUG-68635
Change-Id: I473b0bf47d045298fd2ae481a29de603a3c1be30
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'qmake/generators/win32/winmakefile.cpp')
-rw-r--r-- | qmake/generators/win32/winmakefile.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index 75bb5d236d..bca27b7044 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -773,6 +773,18 @@ QString Win32MakefileGenerator::escapeFilePath(const QString &path) const return ret; } +QString Win32MakefileGenerator::escapeDependencyPath(const QString &path) const +{ + QString ret = path; + if (!ret.isEmpty()) { + static const QRegExp criticalChars(QStringLiteral("([\t #])")); + if (ret.contains(criticalChars)) + ret = "\"" + ret + "\""; + debug_msg(2, "EscapeDependencyPath: %s -> %s", path.toLatin1().constData(), ret.toLatin1().constData()); + } + return ret; +} + QString Win32MakefileGenerator::cQuoted(const QString &str) { QString ret = str; |