forked from qt-creator/qt-creator
Qmake: Show real effective make call on Make step - take 2
Include custom Makefile. Change-Id: Ibc6a341590f8b1ff0da2fa87f5e5bcd75182b6a7 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
92c067ba36
commit
d26140e7f1
@@ -85,7 +85,7 @@ bool MakeStep::init()
|
|||||||
if (!bc)
|
if (!bc)
|
||||||
emit addTask(Task::buildConfigurationMissingTask());
|
emit addTask(Task::buildConfigurationMissingTask());
|
||||||
|
|
||||||
const CommandLine make = effectiveMakeCommand();
|
const CommandLine make = effectiveMakeCommand(Execution);
|
||||||
if (make.executable().isEmpty())
|
if (make.executable().isEmpty())
|
||||||
emit addTask(makeCommandMissingTask());
|
emit addTask(makeCommandMissingTask());
|
||||||
|
|
||||||
@@ -323,15 +323,27 @@ void MakeStep::setUserArguments(const QString &args)
|
|||||||
m_userArguments = args;
|
m_userArguments = args;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QStringList MakeStep::displayArguments() const
|
||||||
|
{
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
FilePath MakeStep::makeCommand() const
|
FilePath MakeStep::makeCommand() const
|
||||||
{
|
{
|
||||||
return m_makeCommand;
|
return m_makeCommand;
|
||||||
}
|
}
|
||||||
|
|
||||||
CommandLine MakeStep::effectiveMakeCommand() const
|
FilePath MakeStep::makeExecutable() const
|
||||||
{
|
{
|
||||||
CommandLine cmd(m_makeCommand.isEmpty() ? defaultMakeCommand() : m_makeCommand);
|
return m_makeCommand.isEmpty() ? defaultMakeCommand() : m_makeCommand;
|
||||||
|
}
|
||||||
|
|
||||||
|
CommandLine MakeStep::effectiveMakeCommand(MakeCommandType type) const
|
||||||
|
{
|
||||||
|
CommandLine cmd(makeExecutable());
|
||||||
|
|
||||||
|
if (type == Display)
|
||||||
|
cmd.addArgs(displayArguments());
|
||||||
cmd.addArgs(m_userArguments, CommandLine::Raw);
|
cmd.addArgs(m_userArguments, CommandLine::Raw);
|
||||||
cmd.addArgs(jobArguments());
|
cmd.addArgs(jobArguments());
|
||||||
cmd.addArgs(m_buildTargets);
|
cmd.addArgs(m_buildTargets);
|
||||||
@@ -431,6 +443,8 @@ MakeStepConfigWidget::MakeStepConfigWidget(MakeStep *makeStep)
|
|||||||
this, &MakeStepConfigWidget::updateDetails);
|
this, &MakeStepConfigWidget::updateDetails);
|
||||||
connect(m_makeStep->buildConfiguration(), &BuildConfiguration::buildDirectoryChanged,
|
connect(m_makeStep->buildConfiguration(), &BuildConfiguration::buildDirectoryChanged,
|
||||||
this, &MakeStepConfigWidget::updateDetails);
|
this, &MakeStepConfigWidget::updateDetails);
|
||||||
|
connect(m_makeStep->project(), &Project::parsingFinished,
|
||||||
|
this, &MakeStepConfigWidget::updateDetails);
|
||||||
|
|
||||||
Core::VariableChooser::addSupportForChildWidgets(this, m_makeStep->macroExpander());
|
Core::VariableChooser::addSupportForChildWidgets(this, m_makeStep->macroExpander());
|
||||||
}
|
}
|
||||||
@@ -464,7 +478,7 @@ void MakeStepConfigWidget::updateDetails()
|
|||||||
else
|
else
|
||||||
m_ui->makeLabel->setText(tr("Override %1:").arg(QDir::toNativeSeparators(defaultMake)));
|
m_ui->makeLabel->setText(tr("Override %1:").arg(QDir::toNativeSeparators(defaultMake)));
|
||||||
|
|
||||||
const CommandLine make = m_makeStep->effectiveMakeCommand();
|
const CommandLine make = m_makeStep->effectiveMakeCommand(MakeStep::Display);
|
||||||
if (make.executable().isEmpty()) {
|
if (make.executable().isEmpty()) {
|
||||||
setSummaryText(tr("<b>Make:</b> %1").arg(MakeStep::msgNoMakeCommand()));
|
setSummaryText(tr("<b>Make:</b> %1").arg(MakeStep::msgNoMakeCommand()));
|
||||||
return;
|
return;
|
||||||
|
@@ -45,6 +45,10 @@ class PROJECTEXPLORER_EXPORT MakeStep : public ProjectExplorer::AbstractProcessS
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
enum MakeCommandType {
|
||||||
|
Display,
|
||||||
|
Execution
|
||||||
|
};
|
||||||
explicit MakeStep(ProjectExplorer::BuildStepList *parent, Core::Id id);
|
explicit MakeStep(ProjectExplorer::BuildStepList *parent, Core::Id id);
|
||||||
|
|
||||||
void setBuildTarget(const QString &buildTarget);
|
void setBuildTarget(const QString &buildTarget);
|
||||||
@@ -59,7 +63,8 @@ public:
|
|||||||
void setUserArguments(const QString &args);
|
void setUserArguments(const QString &args);
|
||||||
Utils::FilePath makeCommand() const;
|
Utils::FilePath makeCommand() const;
|
||||||
void setMakeCommand(const Utils::FilePath &command);
|
void setMakeCommand(const Utils::FilePath &command);
|
||||||
Utils::CommandLine effectiveMakeCommand() const;
|
Utils::FilePath makeExecutable() const;
|
||||||
|
Utils::CommandLine effectiveMakeCommand(MakeCommandType type) const;
|
||||||
|
|
||||||
void setClean(bool clean);
|
void setClean(bool clean);
|
||||||
bool isClean() const;
|
bool isClean() const;
|
||||||
@@ -88,6 +93,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
bool fromMap(const QVariantMap &map) override;
|
bool fromMap(const QVariantMap &map) override;
|
||||||
void supportDisablingForSubdirs() { m_disablingForSubDirsSupported = true; }
|
void supportDisablingForSubdirs() { m_disablingForSubDirsSupported = true; }
|
||||||
|
virtual QStringList displayArguments() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QVariantMap toMap() const override;
|
QVariantMap toMap() const override;
|
||||||
|
@@ -946,7 +946,7 @@ MakeInstallCommand Project::makeInstallCommand(const Target *target, const QStri
|
|||||||
if (const BuildConfiguration * const bc = target->activeBuildConfiguration()) {
|
if (const BuildConfiguration * const bc = target->activeBuildConfiguration()) {
|
||||||
if (const auto makeStep = bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD)
|
if (const auto makeStep = bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD)
|
||||||
->firstOfType<MakeStep>()) {
|
->firstOfType<MakeStep>()) {
|
||||||
cmd.command = makeStep->effectiveMakeCommand().executable();
|
cmd.command = makeStep->makeExecutable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cmd.arguments << "install" << ("INSTALL_ROOT=" + QDir::toNativeSeparators(installRoot));
|
cmd.arguments << "install" << ("INSTALL_ROOT=" + QDir::toNativeSeparators(installRoot));
|
||||||
|
@@ -69,7 +69,7 @@ bool QmakeMakeStep::init()
|
|||||||
if (!bc)
|
if (!bc)
|
||||||
emit addTask(Task::buildConfigurationMissingTask());
|
emit addTask(Task::buildConfigurationMissingTask());
|
||||||
|
|
||||||
const Utils::CommandLine unmodifiedMake = effectiveMakeCommand();
|
const Utils::CommandLine unmodifiedMake = effectiveMakeCommand(Execution);
|
||||||
const Utils::FilePath makeExecutable = unmodifiedMake.executable();
|
const Utils::FilePath makeExecutable = unmodifiedMake.executable();
|
||||||
if (makeExecutable.isEmpty())
|
if (makeExecutable.isEmpty())
|
||||||
emit addTask(makeCommandMissingTask());
|
emit addTask(makeCommandMissingTask());
|
||||||
@@ -212,6 +212,14 @@ void QmakeMakeStep::finish(bool success)
|
|||||||
MakeStep::finish(success);
|
MakeStep::finish(success);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QStringList QmakeMakeStep::displayArguments() const
|
||||||
|
{
|
||||||
|
const auto bc = static_cast<QmakeBuildConfiguration *>(buildConfiguration());
|
||||||
|
if (bc && !bc->makefile().isEmpty())
|
||||||
|
return {"-f", bc->makefile()};
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
// QmakeMakeStepFactory
|
// QmakeMakeStepFactory
|
||||||
///
|
///
|
||||||
|
@@ -53,6 +53,7 @@ private:
|
|||||||
void finish(bool success) override;
|
void finish(bool success) override;
|
||||||
bool init() override;
|
bool init() override;
|
||||||
void doRun() override;
|
void doRun() override;
|
||||||
|
QStringList displayArguments() const override;
|
||||||
|
|
||||||
bool m_scriptTarget = false;
|
bool m_scriptTarget = false;
|
||||||
QString m_makeFileToCheck;
|
QString m_makeFileToCheck;
|
||||||
|
@@ -443,8 +443,9 @@ void QMakeStep::setSeparateDebugInfo(bool enable)
|
|||||||
|
|
||||||
FilePath QMakeStep::makeCommand() const
|
FilePath QMakeStep::makeCommand() const
|
||||||
{
|
{
|
||||||
auto ms = stepList()->firstOfType<MakeStep>();
|
if (auto ms = stepList()->firstOfType<MakeStep>())
|
||||||
return ms ? ms->effectiveMakeCommand().executable() : FilePath();
|
return ms->makeExecutable();
|
||||||
|
return FilePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QMakeStep::makeArguments(const QString &makefile) const
|
QString QMakeStep::makeArguments(const QString &makefile) const
|
||||||
|
@@ -214,7 +214,7 @@ void MakeInstallStep::updateFullCommandLine()
|
|||||||
// FIXME: Only executable?
|
// FIXME: Only executable?
|
||||||
static_cast<BaseStringAspect *>(aspect(FullCommandLineAspectId))->setValue(
|
static_cast<BaseStringAspect *>(aspect(FullCommandLineAspectId))->setValue(
|
||||||
QDir::toNativeSeparators(
|
QDir::toNativeSeparators(
|
||||||
QtcProcess::quoteArg(effectiveMakeCommand().executable().toString()))
|
QtcProcess::quoteArg(makeExecutable().toString()))
|
||||||
+ ' ' + userArguments());
|
+ ' ' + userArguments());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user