diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2017-04-21 09:57:19 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2017-04-28 11:08:05 +0000 |
commit | b4aa71223c18599302d600b079e20fc0fb51009a (patch) | |
tree | 70243969c32958fe89489cb45948599c2a1309eb /src | |
parent | 9503948fd9195f0d07456e66e4dbf7c781f82ef8 (diff) |
Support command files in cpp.{static,dynamic}Libraries
We will make use of that in a follow-up patch.
Change-Id: I1fb6ca0938bbcc6f53bd0046761023a1b8563949
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/corelib/buildgraph/processcommandexecutor.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lib/corelib/buildgraph/processcommandexecutor.cpp b/src/lib/corelib/buildgraph/processcommandexecutor.cpp index 3efcc2653..25a80f5be 100644 --- a/src/lib/corelib/buildgraph/processcommandexecutor.cpp +++ b/src/lib/corelib/buildgraph/processcommandexecutor.cpp @@ -144,7 +144,18 @@ void ProcessCommandExecutor::doStart() return; } for (int i = cmd->responseFileArgumentIndex(); i < cmd->arguments().count(); ++i) { - responseFile.write(qbs::Internal::shellQuote(cmd->arguments().at(i)).toLocal8Bit()); + const QString arg = cmd->arguments().at(i); + if (arg.startsWith(cmd->responseFileUsagePrefix())) { + QFile f(arg.mid(cmd->responseFileUsagePrefix().count())); + if (!f.open(QIODevice::ReadOnly)) { + emit finished(ErrorInfo(Tr::tr("Cannot open command file '%1'.") + .arg(QDir::toNativeSeparators(f.fileName())))); + return; + } + responseFile.write(f.readAll()); + } else { + responseFile.write(qbs::Internal::shellQuote(arg).toLocal8Bit()); + } responseFile.write("\n"); } responseFile.close(); |