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.setEnvironment(env);
|
||||||
cpp.setTimeoutS(10);
|
cpp.setTimeoutS(10);
|
||||||
|
|
||||||
QStringList arguments;
|
CommandLine cmd(compiler, {});
|
||||||
arguments.push_back(fakeIn.fileName());
|
cmd.addArg(fakeIn.fileName());
|
||||||
if (languageId == ProjectExplorer::Constants::CXX_LANGUAGE_ID)
|
if (languageId == ProjectExplorer::Constants::CXX_LANGUAGE_ID)
|
||||||
arguments.push_back("--ec++");
|
cmd.addArg("--ec++");
|
||||||
arguments.push_back("--predef_macros");
|
cmd.addArg("--predef_macros");
|
||||||
arguments.push_back(outpath);
|
cmd.addArg(outpath);
|
||||||
|
|
||||||
const SynchronousProcessResponse response = cpp.runBlocking(compiler.toString(), arguments);
|
const SynchronousProcessResponse response = cpp.runBlocking(cmd);
|
||||||
if (response.result != SynchronousProcessResponse::Finished
|
if (response.result != SynchronousProcessResponse::Finished
|
||||||
|| response.exitCode != 0) {
|
|| response.exitCode != 0) {
|
||||||
qWarning() << response.exitMessage(compiler.toString(), 10);
|
qWarning() << response.exitMessage(cmd.toUserOutput(), 10);
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,16 +131,15 @@ static HeaderPaths dumpHeaderPaths(const FilePath &compiler, const Core::Id lang
|
|||||||
cpp.setEnvironment(env);
|
cpp.setEnvironment(env);
|
||||||
cpp.setTimeoutS(10);
|
cpp.setTimeoutS(10);
|
||||||
|
|
||||||
QStringList arguments;
|
CommandLine cmd(compiler, {});
|
||||||
arguments.push_back(fakeIn.fileName());
|
cmd.addArg(fakeIn.fileName());
|
||||||
if (languageId == ProjectExplorer::Constants::CXX_LANGUAGE_ID)
|
if (languageId == ProjectExplorer::Constants::CXX_LANGUAGE_ID)
|
||||||
arguments.push_back("--ec++");
|
cmd.addArg("--ec++");
|
||||||
arguments.push_back("--preinclude");
|
cmd.addArg("--preinclude");
|
||||||
arguments.push_back(".");
|
cmd.addArg(".");
|
||||||
|
|
||||||
// Note: Response should retutn an error, just don't check on errors.
|
// Note: Response should retutn an error, just don't check on errors.
|
||||||
const SynchronousProcessResponse response = cpp.runBlocking(compiler.toString(),
|
const SynchronousProcessResponse response = cpp.runBlocking(cmd);
|
||||||
arguments);
|
|
||||||
|
|
||||||
HeaderPaths headerPaths;
|
HeaderPaths headerPaths;
|
||||||
|
|
||||||
|
@@ -102,13 +102,13 @@ static Macros dumpC51PredefinedMacros(const FilePath &compiler, const QStringLis
|
|||||||
cpp.setEnvironment(env);
|
cpp.setEnvironment(env);
|
||||||
cpp.setTimeoutS(10);
|
cpp.setTimeoutS(10);
|
||||||
|
|
||||||
QStringList arguments;
|
CommandLine cmd(compiler, {});
|
||||||
arguments.push_back(fakeIn.fileName());
|
cmd.addArg(fakeIn.fileName());
|
||||||
|
|
||||||
const SynchronousProcessResponse response = cpp.runBlocking(compiler.toString(), arguments);
|
const SynchronousProcessResponse response = cpp.runBlocking(cmd);
|
||||||
if (response.result != SynchronousProcessResponse::Finished
|
if (response.result != SynchronousProcessResponse::Finished
|
||||||
|| response.exitCode != 0) {
|
|| response.exitCode != 0) {
|
||||||
qWarning() << response.exitMessage(compiler.toString(), 10);
|
qWarning() << response.exitMessage(cmd.toUserOutput(), 10);
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,11 +131,10 @@ static Macros dumpArmPredefinedMacros(const FilePath &compiler, const QStringLis
|
|||||||
cpp.setEnvironment(env);
|
cpp.setEnvironment(env);
|
||||||
cpp.setTimeoutS(10);
|
cpp.setTimeoutS(10);
|
||||||
|
|
||||||
QStringList arguments;
|
CommandLine cmd(compiler, {});
|
||||||
arguments.push_back("-E");
|
cmd.addArgs({"-E", "--list-macros"});
|
||||||
arguments.push_back("--list-macros");
|
|
||||||
|
|
||||||
const SynchronousProcessResponse response = cpp.runBlocking(compiler.toString(), arguments);
|
const SynchronousProcessResponse response = cpp.runBlocking(cmd);
|
||||||
if (response.result != SynchronousProcessResponse::Finished
|
if (response.result != SynchronousProcessResponse::Finished
|
||||||
|| response.exitCode != 0) {
|
|| response.exitCode != 0) {
|
||||||
qWarning() << response.exitMessage(compiler.toString(), 10);
|
qWarning() << response.exitMessage(compiler.toString(), 10);
|
||||||
|
@@ -92,13 +92,10 @@ static Macros dumpPredefinedMacros(const FilePath &compiler, const QStringList &
|
|||||||
cpp.setEnvironment(env);
|
cpp.setEnvironment(env);
|
||||||
cpp.setTimeoutS(10);
|
cpp.setTimeoutS(10);
|
||||||
|
|
||||||
QStringList arguments;
|
CommandLine cmd(compiler, {});
|
||||||
arguments.push_back(compilerTargetFlag(abi));
|
cmd.addArgs({compilerTargetFlag(abi), "-dM", "-E", fakeIn.fileName()});
|
||||||
arguments.push_back("-dM");
|
|
||||||
arguments.push_back("-E");
|
|
||||||
arguments.push_back(fakeIn.fileName());
|
|
||||||
|
|
||||||
const SynchronousProcessResponse response = cpp.runBlocking(compiler.toString(), arguments);
|
const SynchronousProcessResponse response = cpp.runBlocking(cmd);
|
||||||
if (response.result != SynchronousProcessResponse::Finished
|
if (response.result != SynchronousProcessResponse::Finished
|
||||||
|| response.exitCode != 0) {
|
|| response.exitCode != 0) {
|
||||||
qWarning() << response.exitMessage(compiler.toString(), 10);
|
qWarning() << response.exitMessage(compiler.toString(), 10);
|
||||||
@@ -119,11 +116,10 @@ static HeaderPaths dumpHeaderPaths(const FilePath &compiler, const QStringList &
|
|||||||
cpp.setEnvironment(env);
|
cpp.setEnvironment(env);
|
||||||
cpp.setTimeoutS(10);
|
cpp.setTimeoutS(10);
|
||||||
|
|
||||||
QStringList arguments;
|
CommandLine cmd(compiler, {});
|
||||||
arguments.push_back(compilerTargetFlag(abi));
|
cmd.addArgs({compilerTargetFlag(abi), "--print-search-dirs"});
|
||||||
arguments.push_back("--print-search-dirs");
|
|
||||||
|
|
||||||
const SynchronousProcessResponse response = cpp.runBlocking(compiler.toString(), arguments);
|
const SynchronousProcessResponse response = cpp.runBlocking(cmd);
|
||||||
if (response.result != SynchronousProcessResponse::Finished
|
if (response.result != SynchronousProcessResponse::Finished
|
||||||
|| response.exitCode != 0) {
|
|| response.exitCode != 0) {
|
||||||
qWarning() << response.exitMessage(compiler.toString(), 10);
|
qWarning() << response.exitMessage(compiler.toString(), 10);
|
||||||
|
Reference in New Issue
Block a user