forked from qt-creator/qt-creator
BareMetal: Some adaptations to new Utils::CommandLine
Change-Id: I79f7d61037e4ed6c7aefaf10adb33308ce98fbd5 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -85,17 +85,17 @@ static Macros dumpPredefinedMacros(const FilePath &compiler, const Core::Id lang
|
||||
cpp.setEnvironment(env);
|
||||
cpp.setTimeoutS(10);
|
||||
|
||||
QStringList arguments;
|
||||
arguments.push_back(fakeIn.fileName());
|
||||
CommandLine cmd(compiler, {});
|
||||
cmd.addArg(fakeIn.fileName());
|
||||
if (languageId == ProjectExplorer::Constants::CXX_LANGUAGE_ID)
|
||||
arguments.push_back("--ec++");
|
||||
arguments.push_back("--predef_macros");
|
||||
arguments.push_back(outpath);
|
||||
cmd.addArg("--ec++");
|
||||
cmd.addArg("--predef_macros");
|
||||
cmd.addArg(outpath);
|
||||
|
||||
const SynchronousProcessResponse response = cpp.runBlocking(compiler.toString(), arguments);
|
||||
const SynchronousProcessResponse response = cpp.runBlocking(cmd);
|
||||
if (response.result != SynchronousProcessResponse::Finished
|
||||
|| response.exitCode != 0) {
|
||||
qWarning() << response.exitMessage(compiler.toString(), 10);
|
||||
qWarning() << response.exitMessage(cmd.toUserOutput(), 10);
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -131,16 +131,15 @@ static HeaderPaths dumpHeaderPaths(const FilePath &compiler, const Core::Id lang
|
||||
cpp.setEnvironment(env);
|
||||
cpp.setTimeoutS(10);
|
||||
|
||||
QStringList arguments;
|
||||
arguments.push_back(fakeIn.fileName());
|
||||
CommandLine cmd(compiler, {});
|
||||
cmd.addArg(fakeIn.fileName());
|
||||
if (languageId == ProjectExplorer::Constants::CXX_LANGUAGE_ID)
|
||||
arguments.push_back("--ec++");
|
||||
arguments.push_back("--preinclude");
|
||||
arguments.push_back(".");
|
||||
cmd.addArg("--ec++");
|
||||
cmd.addArg("--preinclude");
|
||||
cmd.addArg(".");
|
||||
|
||||
// Note: Response should retutn an error, just don't check on errors.
|
||||
const SynchronousProcessResponse response = cpp.runBlocking(compiler.toString(),
|
||||
arguments);
|
||||
const SynchronousProcessResponse response = cpp.runBlocking(cmd);
|
||||
|
||||
HeaderPaths headerPaths;
|
||||
|
||||
|
@@ -102,13 +102,13 @@ static Macros dumpC51PredefinedMacros(const FilePath &compiler, const QStringLis
|
||||
cpp.setEnvironment(env);
|
||||
cpp.setTimeoutS(10);
|
||||
|
||||
QStringList arguments;
|
||||
arguments.push_back(fakeIn.fileName());
|
||||
CommandLine cmd(compiler, {});
|
||||
cmd.addArg(fakeIn.fileName());
|
||||
|
||||
const SynchronousProcessResponse response = cpp.runBlocking(compiler.toString(), arguments);
|
||||
const SynchronousProcessResponse response = cpp.runBlocking(cmd);
|
||||
if (response.result != SynchronousProcessResponse::Finished
|
||||
|| response.exitCode != 0) {
|
||||
qWarning() << response.exitMessage(compiler.toString(), 10);
|
||||
qWarning() << response.exitMessage(cmd.toUserOutput(), 10);
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -131,11 +131,10 @@ static Macros dumpArmPredefinedMacros(const FilePath &compiler, const QStringLis
|
||||
cpp.setEnvironment(env);
|
||||
cpp.setTimeoutS(10);
|
||||
|
||||
QStringList arguments;
|
||||
arguments.push_back("-E");
|
||||
arguments.push_back("--list-macros");
|
||||
CommandLine cmd(compiler, {});
|
||||
cmd.addArgs({"-E", "--list-macros"});
|
||||
|
||||
const SynchronousProcessResponse response = cpp.runBlocking(compiler.toString(), arguments);
|
||||
const SynchronousProcessResponse response = cpp.runBlocking(cmd);
|
||||
if (response.result != SynchronousProcessResponse::Finished
|
||||
|| response.exitCode != 0) {
|
||||
qWarning() << response.exitMessage(compiler.toString(), 10);
|
||||
|
@@ -92,13 +92,10 @@ static Macros dumpPredefinedMacros(const FilePath &compiler, const QStringList &
|
||||
cpp.setEnvironment(env);
|
||||
cpp.setTimeoutS(10);
|
||||
|
||||
QStringList arguments;
|
||||
arguments.push_back(compilerTargetFlag(abi));
|
||||
arguments.push_back("-dM");
|
||||
arguments.push_back("-E");
|
||||
arguments.push_back(fakeIn.fileName());
|
||||
CommandLine cmd(compiler, {});
|
||||
cmd.addArgs({compilerTargetFlag(abi), "-dM", "-E", fakeIn.fileName()});
|
||||
|
||||
const SynchronousProcessResponse response = cpp.runBlocking(compiler.toString(), arguments);
|
||||
const SynchronousProcessResponse response = cpp.runBlocking(cmd);
|
||||
if (response.result != SynchronousProcessResponse::Finished
|
||||
|| response.exitCode != 0) {
|
||||
qWarning() << response.exitMessage(compiler.toString(), 10);
|
||||
@@ -119,11 +116,10 @@ static HeaderPaths dumpHeaderPaths(const FilePath &compiler, const QStringList &
|
||||
cpp.setEnvironment(env);
|
||||
cpp.setTimeoutS(10);
|
||||
|
||||
QStringList arguments;
|
||||
arguments.push_back(compilerTargetFlag(abi));
|
||||
arguments.push_back("--print-search-dirs");
|
||||
CommandLine cmd(compiler, {});
|
||||
cmd.addArgs({compilerTargetFlag(abi), "--print-search-dirs"});
|
||||
|
||||
const SynchronousProcessResponse response = cpp.runBlocking(compiler.toString(), arguments);
|
||||
const SynchronousProcessResponse response = cpp.runBlocking(cmd);
|
||||
if (response.result != SynchronousProcessResponse::Finished
|
||||
|| response.exitCode != 0) {
|
||||
qWarning() << response.exitMessage(compiler.toString(), 10);
|
||||
|
Reference in New Issue
Block a user