Commit 0c92ec0e authored by Daniel Teske's avatar Daniel Teske

Qt4ProjectManager Makestep: Add "-r" to disable built-in rules

They slow down make by quite a lot. If there's nothing to do it's a 2-3
times speedup to skip those rules. This patch does that unconditionally,
similar to the -w parameter.

Task-number: QTCREATORBUG-8693
Change-Id: I951308195af3666744ad5e0ca865f42bbf6b5f79
Reviewed-by: default avatarOswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent c90815e2
......@@ -58,6 +58,7 @@ using namespace Qt4ProjectManager::Internal;
namespace {
const char MAKESTEP_BS_ID[] = "Qt4ProjectManager.MakeStep";
const char MAKE_ARGUMENTS_KEY[] = "Qt4ProjectManager.MakeStep.MakeArguments";
const char AUTOMATICLY_ADDED_MAKE_ARGUMENTS_KEY[] = "Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments";
const char MAKE_COMMAND_KEY[] = "Qt4ProjectManager.MakeStep.MakeCommand";
const char CLEAN_KEY[] = "Qt4ProjectManager.MakeStep.Clean";
}
......@@ -125,14 +126,30 @@ QVariantMap MakeStep::toMap() const
map.insert(QLatin1String(MAKE_ARGUMENTS_KEY), m_userArgs);
map.insert(QLatin1String(MAKE_COMMAND_KEY), m_makeCmd);
map.insert(QLatin1String(CLEAN_KEY), m_clean);
map.insert(QLatin1String(AUTOMATICLY_ADDED_MAKE_ARGUMENTS_KEY), automaticallyAddedArguments());
return map;
}
QStringList MakeStep::automaticallyAddedArguments() const
{
ToolChain *tc = ToolChainKitInformation::toolChain(target()->kit());
if (!tc || tc->targetAbi().binaryFormat() == Abi::PEFormat)
return QStringList();
return QStringList() << QLatin1String("-w") << QLatin1String("-r");
}
bool MakeStep::fromMap(const QVariantMap &map)
{
m_makeCmd = map.value(QLatin1String(MAKE_COMMAND_KEY)).toString();
m_userArgs = map.value(QLatin1String(MAKE_ARGUMENTS_KEY)).toString();
m_clean = map.value(QLatin1String(CLEAN_KEY)).toBool();
QStringList oldAddedArgs
= map.value(QLatin1String(AUTOMATICLY_ADDED_MAKE_ARGUMENTS_KEY)).toStringList();
foreach (const QString &newArg, automaticallyAddedArguments()) {
if (oldAddedArgs.contains(newArg))
continue;
m_userArgs.prepend(newArg + QLatin1Char(' '));
}
return AbstractProcessStep::fromMap(map);
}
......@@ -224,15 +241,8 @@ bool MakeStep::init()
// Force output to english for the parsers. Do this here and not in the toolchain's
// addToEnvironment() to not screw up the users run environment.
env.set(QLatin1String("LC_ALL"), QLatin1String("C"));
// -w option enables "Enter"/"Leaving directory" messages, which we need for detecting the
// absolute file path
// doing this without the user having a way to override this is rather bad
// so we only do it for unix and if the user didn't override the make command
// but for now this is the least invasive change
// We also prepend "L" to the MAKEFLAGS, so that nmake / jom are less verbose
if (tc && m_makeCmd.isEmpty()) {
if (tc->targetAbi().binaryFormat() != Abi::PEFormat )
Utils::QtcProcess::addArg(&args, QLatin1String("-w"));
if (tc->targetAbi().os() == Abi::WindowsOS
&& tc->targetAbi().osFlavor() != Abi::WindowsMSysFlavor) {
const QString makeFlags = QLatin1String("MAKEFLAGS");
......@@ -424,15 +434,9 @@ void MakeStepConfigWidget::updateDetails()
// Force output to english for the parsers. Do this here and not in the toolchain's
// addToEnvironment() to not screw up the users run environment.
env.set(QLatin1String("LC_ALL"), QLatin1String("C"));
// -w option enables "Enter"/"Leaving directory" messages, which we need for detecting the
// absolute file path
// We prepend "L" to the MAKEFLAGS, so that nmake / jom are less verbose
// FIXME doing this without the user having a way to override this is rather bad
// so we only do it for unix and if the user didn't override the make command
// but for now this is the least invasive change
// We also prepend "L" to the MAKEFLAGS, so that nmake / jom are less verbose
if (tc && m_makeStep->makeCommand().isEmpty()) {
if (tc->targetAbi().binaryFormat() != Abi::PEFormat )
Utils::QtcProcess::addArg(&args, QLatin1String("-w"));
if (tc->targetAbi().os() == Abi::WindowsOS
&& tc->targetAbi().osFlavor() != Abi::WindowsMSysFlavor) {
const QString makeFlags = QLatin1String("MAKEFLAGS");
......
......@@ -109,6 +109,7 @@ protected:
private:
void ctor();
void setMakeCommand(const QString &make);
QStringList automaticallyAddedArguments() const;
bool m_clean;
bool m_scriptTarget;
QString m_makeFileToCheck;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment