Autotools: De-Q_OBJECT-ify build related classes

Only used for translations, and that can be achieved much cheaper
without the extra translation units created by moc.

This reduces the size of the autotoolsprojectmanagers/.obj build
dir from 23220 kB to 17696 kB for my debug buld.

Take the opportunity to sprinkle in a few 'final'.

Change-Id: I85b36c6b8ca58469d0906f1105b2b1587b7c7e6c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2020-01-09 14:00:22 +01:00
parent 5cd0749830
commit 9686e91bd5
12 changed files with 204 additions and 216 deletions

View File

@@ -30,22 +30,25 @@
#include "autotoolsbuildconfiguration.h"
#include "autotoolsprojectconstants.h"
#include <projectexplorer/abstractprocessstep.h>
#include <projectexplorer/processparameters.h>
#include <projectexplorer/projectconfigurationaspects.h>
#include <projectexplorer/project.h>
#include <projectexplorer/target.h>
#include <QDateTime>
#include <QDir>
using namespace AutotoolsProjectManager;
using namespace AutotoolsProjectManager::Internal;
using namespace ProjectExplorer;
using namespace Utils;
/////////////////////
namespace AutotoolsProjectManager {
namespace Internal {
// Helper Function
/////////////////////
static QString projectDirRelativeToBuildDir(BuildConfiguration *bc) {
static QString projectDirRelativeToBuildDir(BuildConfiguration *bc)
{
const QDir buildDir(bc->buildDirectory().toString());
QString projDirToBuildDir = buildDir.relativeFilePath(
bc->project()->projectDirectory().toString());
@@ -56,20 +59,36 @@ static QString projectDirRelativeToBuildDir(BuildConfiguration *bc) {
return projDirToBuildDir;
}
// ConfigureStepFactory
ConfigureStepFactory::ConfigureStepFactory()
{
registerStep<ConfigureStep>(Constants::CONFIGURE_STEP_ID);
setDisplayName(ConfigureStep::tr("Configure", "Display name for AutotoolsProjectManager::ConfigureStep id."));
setSupportedProjectType(Constants::AUTOTOOLS_PROJECT_ID);
setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
}
// ConfigureStep
///**
// * @brief Implementation of the ProjectExplorer::AbstractProcessStep interface.
// *
// * A configure step can be configured by selecting the "Projects" button of Qt
// * Creator (in the left hand side menu) and under "Build Settings".
// *
// * It is possible for the user to specify custom arguments. The corresponding
// * configuration widget is created by MakeStep::createConfigWidget and is
// * represented by an instance of the class MakeStepConfigWidget.
// */
class ConfigureStep : public ProjectExplorer::AbstractProcessStep
{
Q_DECLARE_TR_FUNCTIONS(AutotoolsProjectManager::Internal::ConfigureStep)
public:
ConfigureStep(BuildStepList *bsl, Core::Id id);
void setAdditionalArguments(const QString &list);
private:
bool init() override;
void doRun() override;
ProjectExplorer::BaseStringAspect *m_additionalArgumentsAspect = nullptr;
bool m_runConfigure = false;
};
ConfigureStep::ConfigureStep(BuildStepList *bsl, Core::Id id)
: AbstractProcessStep(bsl, id)
{
@@ -139,3 +158,22 @@ void ConfigureStep::doRun()
m_runConfigure = false;
AbstractProcessStep::doRun();
}
// ConfigureStepFactory
/**
* @brief Implementation of the ProjectExplorer::IBuildStepFactory interface.
*
* The factory is used to create instances of ConfigureStep.
*/
ConfigureStepFactory::ConfigureStepFactory()
{
registerStep<ConfigureStep>(Constants::CONFIGURE_STEP_ID);
setDisplayName(ConfigureStep::tr("Configure", "Display name for AutotoolsProjectManager::ConfigureStep id."));
setSupportedProjectType(Constants::AUTOTOOLS_PROJECT_ID);
setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
}
} // namespace Internal
} // namespace AutotoolsProjectManager