diff --git a/src/plugins/baremetal/iarewtoolchain.cpp b/src/plugins/baremetal/iarewtoolchain.cpp index 1955a0fec78..caa91eb545d 100644 --- a/src/plugins/baremetal/iarewtoolchain.cpp +++ b/src/plugins/baremetal/iarewtoolchain.cpp @@ -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; diff --git a/src/plugins/baremetal/keiltoolchain.cpp b/src/plugins/baremetal/keiltoolchain.cpp index 303efa34404..be841a43cf1 100644 --- a/src/plugins/baremetal/keiltoolchain.cpp +++ b/src/plugins/baremetal/keiltoolchain.cpp @@ -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); diff --git a/src/plugins/baremetal/sdcctoolchain.cpp b/src/plugins/baremetal/sdcctoolchain.cpp index b839a68fe8e..a8fa1a039ed 100644 --- a/src/plugins/baremetal/sdcctoolchain.cpp +++ b/src/plugins/baremetal/sdcctoolchain.cpp @@ -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);