Meson: Simplify settings setup a bit

Also some surrounding code.

Change-Id: I9f537a4357ab76295b7cb4f6a69749a0a6b55392
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2023-05-26 11:19:53 +02:00
parent 78eb97fb54
commit c2fcd17e91
6 changed files with 40 additions and 60 deletions

View File

@@ -44,7 +44,7 @@ NinjaBuildStep::NinjaBuildStep(BuildStepList *bsl, Id id)
setUseEnglishOutput();
connect(target(), &ProjectExplorer::Target::parsingFinished, this, &NinjaBuildStep::update);
connect(&Settings::instance()->verboseNinja, &BaseAspect::changed,
connect(&settings().verboseNinja, &BaseAspect::changed,
this, &NinjaBuildStep::commandChanged);
}
@@ -119,17 +119,15 @@ QWidget *NinjaBuildStep::createConfigWidget()
// --verbose is only supported since
// https://github.com/ninja-build/ninja/commit/bf7517505ad1def03e13bec2b4131399331bc5c4
// TODO check when to switch back to --verbose
Utils::CommandLine NinjaBuildStep::command()
CommandLine NinjaBuildStep::command()
{
Utils::CommandLine cmd = [this] {
auto tool = NinjaToolKitAspect::ninjaTool(kit());
if (tool)
return Utils::CommandLine{tool->exe()};
return Utils::CommandLine{};
}();
CommandLine cmd;
if (auto tool = NinjaToolKitAspect::ninjaTool(kit()))
cmd.setExecutable(tool->exe());
if (!m_commandArgs.isEmpty())
cmd.addArgs(m_commandArgs, Utils::CommandLine::RawType::Raw);
if (Settings::instance()->verboseNinja.value())
cmd.addArgs(m_commandArgs, CommandLine::RawType::Raw);
if (settings().verboseNinja())
cmd.addArg("-v");
cmd.addArg(m_targetName);
return cmd;