forked from qt-creator/qt-creator
Remove support for !shadowBuild
In ancient times we needed to support some qt versions that didn't support shadow building. This code has been unused for some versions now, so remove it completely. Change-Id: I311f255d6bfed6841e94c9c383bd9929d0d55520 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
@@ -182,7 +182,6 @@ BuildInfo *AutotoolsBuildConfigurationFactory::createBuildInfo(const Kit *k,
|
||||
info->typeName = tr("Build");
|
||||
info->buildDirectory = buildDir;
|
||||
info->kitId = k->id();
|
||||
info->supportsShadowBuild = true; // Works sometimes...
|
||||
|
||||
return info;
|
||||
}
|
||||
|
@@ -275,7 +275,6 @@ CMakeBuildInfo *CMakeBuildConfigurationFactory::createBuildInfo(const ProjectExp
|
||||
k->addToEnvironment(info->environment);
|
||||
info->useNinja = false;
|
||||
info->sourceDirectory = sourceDir;
|
||||
info->supportsShadowBuild = true;
|
||||
|
||||
return info;
|
||||
}
|
||||
|
@@ -45,7 +45,7 @@ class IBuildConfigurationFactory;
|
||||
class PROJECTEXPLORER_EXPORT BuildInfo
|
||||
{
|
||||
public:
|
||||
BuildInfo(const IBuildConfigurationFactory *f) : supportsShadowBuild(false), m_factory(f) { }
|
||||
BuildInfo(const IBuildConfigurationFactory *f) : m_factory(f) { }
|
||||
virtual ~BuildInfo() { }
|
||||
|
||||
const IBuildConfigurationFactory *factory() const { return m_factory; }
|
||||
@@ -54,7 +54,6 @@ public:
|
||||
QString typeName;
|
||||
Utils::FileName buildDirectory;
|
||||
Core::Id kitId;
|
||||
bool supportsShadowBuild;
|
||||
|
||||
virtual QList<Task> reportIssues(const QString &projectPath,
|
||||
const QString &buildDir) const
|
||||
|
@@ -179,9 +179,8 @@ void TargetSetupWidget::addBuildInfo(BuildInfo *info, bool isImport)
|
||||
Utils::PathChooser *pathChooser = new Utils::PathChooser();
|
||||
pathChooser->setExpectedKind(Utils::PathChooser::Directory);
|
||||
pathChooser->setFileName(info->buildDirectory);
|
||||
pathChooser->setEnabled(info->supportsShadowBuild);
|
||||
pathChooser->setHistoryCompleter(QLatin1String("TargetSetup.BuildDir.History"));
|
||||
pathChooser->setReadOnly(!info->supportsShadowBuild || isImport);
|
||||
pathChooser->setReadOnly(isImport);
|
||||
m_newBuildsLayout->addWidget(pathChooser, pos * 2, 1);
|
||||
|
||||
QLabel *reportIssuesLabel = new QLabel;
|
||||
|
@@ -376,7 +376,6 @@ BuildInfo *QbsBuildConfigurationFactory::createBuildInfo(const Kit *k,
|
||||
info->typeName = tr("Build");
|
||||
info->kitId = k->id();
|
||||
info->type = type;
|
||||
info->supportsShadowBuild = true;
|
||||
return info;
|
||||
}
|
||||
|
||||
|
@@ -77,11 +77,6 @@ QString QmakeBuildConfiguration::shadowBuildDirectory(const QString &proFilePath
|
||||
{
|
||||
if (proFilePath.isEmpty())
|
||||
return QString();
|
||||
QFileInfo info(proFilePath);
|
||||
|
||||
BaseQtVersion *version = QtKitInformation::qtVersion(k);
|
||||
if (version && !version->supportsShadowBuilds())
|
||||
return info.absolutePath();
|
||||
|
||||
const QString projectName = QFileInfo(proFilePath).completeBaseName();
|
||||
ProjectMacroExpander expander(projectName, k, suffix);
|
||||
@@ -90,14 +85,11 @@ QString QmakeBuildConfiguration::shadowBuildDirectory(const QString &proFilePath
|
||||
return FileUtils::resolvePath(projectDir, buildPath);
|
||||
}
|
||||
|
||||
static Utils::FileName defaultBuildDirectory(bool supportsShadowBuild,
|
||||
const QString &projectPath,
|
||||
static Utils::FileName defaultBuildDirectory(const QString &projectPath,
|
||||
const ProjectExplorer::Kit *k,
|
||||
const QString &suffix)
|
||||
{
|
||||
if (supportsShadowBuild)
|
||||
return Utils::FileName::fromString(QmakeBuildConfiguration::shadowBuildDirectory(projectPath, k, suffix));
|
||||
return ProjectExplorer::Project::projectDirectory(Utils::FileName::fromString(projectPath));
|
||||
return Utils::FileName::fromString(QmakeBuildConfiguration::shadowBuildDirectory(projectPath, k, suffix));
|
||||
}
|
||||
|
||||
const char QMAKE_BC_ID[] = "Qt4ProjectManager.Qt4BuildConfiguration";
|
||||
@@ -160,8 +152,6 @@ bool QmakeBuildConfiguration::fromMap(const QVariantMap &map)
|
||||
m_shadowBuild = map.value(QLatin1String(USE_SHADOW_BUILD_KEY), true).toBool();
|
||||
m_qmakeBuildConfiguration = BaseQtVersion::QmakeBuildConfigs(map.value(QLatin1String(BUILD_CONFIGURATION_KEY)).toInt());
|
||||
|
||||
m_qtVersionSupportsShadowBuilds = supportsShadowBuilds();
|
||||
|
||||
m_lastKitState = LastKitState(target()->kit());
|
||||
|
||||
connect(ProjectExplorer::ToolChainManager::instance(), SIGNAL(toolChainUpdated(ProjectExplorer::ToolChain*)),
|
||||
@@ -187,7 +177,6 @@ void QmakeBuildConfiguration::kitChanged()
|
||||
// For that reason the QmakeBuildConfiguration is also connected
|
||||
// to the toolchain and qtversion managers
|
||||
emitProFileEvaluateNeeded();
|
||||
updateShadowBuild();
|
||||
m_lastKitState = newState;
|
||||
}
|
||||
}
|
||||
@@ -204,17 +193,6 @@ void QmakeBuildConfiguration::qtVersionsChanged(const QList<int> &,const QList<i
|
||||
emitProFileEvaluateNeeded();
|
||||
}
|
||||
|
||||
void QmakeBuildConfiguration::updateShadowBuild()
|
||||
{
|
||||
// We also emit buildDirectoryChanged if the Qt version's supportShadowBuild changed
|
||||
bool currentShadowBuild = supportsShadowBuilds();
|
||||
if (currentShadowBuild != m_qtVersionSupportsShadowBuilds) {
|
||||
if (!currentShadowBuild)
|
||||
setBuildDirectory(target()->project()->projectDirectory());
|
||||
m_qtVersionSupportsShadowBuilds = currentShadowBuild;
|
||||
}
|
||||
}
|
||||
|
||||
NamedWidget *QmakeBuildConfiguration::createConfigWidget()
|
||||
{
|
||||
return new QmakeProjectConfigWidget(this);
|
||||
@@ -227,12 +205,6 @@ QString QmakeBuildConfiguration::defaultShadowBuildDirectory() const
|
||||
target()->kit(), displayName());
|
||||
}
|
||||
|
||||
bool QmakeBuildConfiguration::supportsShadowBuilds()
|
||||
{
|
||||
BaseQtVersion *version = QtKitInformation::qtVersion(target()->kit());
|
||||
return !version || version->supportsShadowBuilds();
|
||||
}
|
||||
|
||||
/// If only a sub tree should be build this function returns which sub node
|
||||
/// should be build
|
||||
/// \see QMakeBuildConfiguration::setSubNodeBuild
|
||||
@@ -276,9 +248,6 @@ void QmakeBuildConfiguration::setBuildDirectory(const FileName &directory)
|
||||
if (directory == buildDirectory())
|
||||
return;
|
||||
BuildConfiguration::setBuildDirectory(directory);
|
||||
QTC_CHECK(supportsShadowBuilds()
|
||||
|| (!supportsShadowBuilds()
|
||||
&& buildDirectory() == target()->project()->projectDirectory()));
|
||||
emitProFileEvaluateNeeded();
|
||||
}
|
||||
|
||||
@@ -389,7 +358,7 @@ QmakeBuildConfiguration::MakefileState QmakeBuildConfiguration::compareToImportF
|
||||
// This copies the settings from userArgs to actualArgs (minus some we
|
||||
// are not interested in), splitting them up into individual strings:
|
||||
extractSpecFromArguments(&userArgs, workingDirectory, version, &actualArgs);
|
||||
actualArgs = qs->deducedArguments() + actualArgs + qs->deducedArgumentsAfter();
|
||||
actualArgs = qs->deducedArguments() + actualArgs;
|
||||
FileName actualSpec = qs->mkspec();
|
||||
|
||||
QString qmakeArgs = result.second;
|
||||
@@ -647,7 +616,6 @@ QmakeBuildInfo *QmakeBuildConfigurationFactory::createBuildInfo(const Kit *k,
|
||||
info->typeName = tr("Build");
|
||||
// Leave info->buildDirectory unset;
|
||||
info->kitId = k->id();
|
||||
info->supportsShadowBuild = (version && version->supportsShadowBuilds());
|
||||
|
||||
// check if this project is in the source directory:
|
||||
Utils::FileName projectFilePath = Utils::FileName::fromString(projectPath);
|
||||
@@ -661,8 +629,7 @@ QmakeBuildInfo *QmakeBuildConfigurationFactory::createBuildInfo(const Kit *k,
|
||||
|
||||
info->buildDirectory = Utils::FileName::fromString(absoluteBuildPath);
|
||||
} else {
|
||||
info->buildDirectory
|
||||
= defaultBuildDirectory(info->supportsShadowBuild, projectPath, k, suffix);
|
||||
info->buildDirectory = defaultBuildDirectory(projectPath, k, suffix);
|
||||
}
|
||||
info->type = type;
|
||||
return info;
|
||||
@@ -745,8 +712,7 @@ void QmakeBuildConfigurationFactory::configureBuildConfiguration(Target *parent,
|
||||
|
||||
Utils::FileName directory = qmakeInfo->buildDirectory;
|
||||
if (directory.isEmpty()) {
|
||||
directory = defaultBuildDirectory(qmakeInfo->supportsShadowBuild,
|
||||
parent->project()->projectFilePath().toString(),
|
||||
directory = defaultBuildDirectory(parent->project()->projectFilePath().toString(),
|
||||
parent->kit(), qmakeInfo->displayName);
|
||||
}
|
||||
|
||||
|
@@ -108,9 +108,6 @@ public:
|
||||
|
||||
BuildType buildType() const;
|
||||
|
||||
/// returns whether the Qt version in the profile supports shadow building (also true for no Qt version)
|
||||
bool supportsShadowBuilds();
|
||||
|
||||
public slots:
|
||||
void emitProFileEvaluateNeeded();
|
||||
|
||||
@@ -134,7 +131,6 @@ protected:
|
||||
private:
|
||||
void ctor();
|
||||
QString defaultShadowBuildDirectory() const;
|
||||
void updateShadowBuild();
|
||||
|
||||
class LastKitState
|
||||
{
|
||||
@@ -153,7 +149,6 @@ private:
|
||||
|
||||
bool m_shadowBuild;
|
||||
bool m_isEnabled;
|
||||
bool m_qtVersionSupportsShadowBuilds;
|
||||
QtSupport::BaseQtVersion::QmakeBuildConfigs m_qmakeBuildConfiguration;
|
||||
QmakeProjectManager::QmakeProFileNode *m_subNodeBuild;
|
||||
ProjectExplorer::FileNode *m_fileNodeBuild;
|
||||
|
@@ -54,7 +54,6 @@ public:
|
||||
&& typeName == o.typeName
|
||||
&& buildDirectory == o.buildDirectory
|
||||
&& kitId == o.kitId
|
||||
&& supportsShadowBuild == o.supportsShadowBuild
|
||||
&& type == o.type
|
||||
&& additionalArguments == o.additionalArguments;
|
||||
}
|
||||
|
@@ -237,13 +237,6 @@ void QmakeProjectConfigWidget::updateProblemLabel()
|
||||
}
|
||||
}
|
||||
|
||||
QString shadowBuildWarning;
|
||||
if (!version->supportsShadowBuilds() && m_buildConfiguration->isShadowBuild()) {
|
||||
shadowBuildWarning = tr("The Qt version %1 does not support shadow builds, building might fail.")
|
||||
.arg(version->displayName())
|
||||
+ QLatin1String("<br>");
|
||||
}
|
||||
|
||||
if (allGood) {
|
||||
QString buildDirectory = m_buildConfiguration->target()->project()->projectDirectory().toString();
|
||||
if (m_buildConfiguration->isShadowBuild())
|
||||
@@ -252,8 +245,8 @@ void QmakeProjectConfigWidget::updateProblemLabel()
|
||||
issues = version->reportIssues(proFileName, buildDirectory);
|
||||
Utils::sort(issues);
|
||||
|
||||
if (!issues.isEmpty() || !shadowBuildWarning.isEmpty()) {
|
||||
QString text = QLatin1String("<nobr>") + shadowBuildWarning;
|
||||
if (!issues.isEmpty()) {
|
||||
QString text = QLatin1String("<nobr>");
|
||||
foreach (const ProjectExplorer::Task &task, issues) {
|
||||
QString type;
|
||||
switch (task.type) {
|
||||
@@ -277,18 +270,15 @@ void QmakeProjectConfigWidget::updateProblemLabel()
|
||||
return;
|
||||
}
|
||||
} else if (targetMismatch) {
|
||||
setProblemLabel(shadowBuildWarning + tr("A build for a different project exists in %1, which will be overwritten.",
|
||||
"%1 build directory")
|
||||
setProblemLabel(tr("A build for a different project exists in %1, which will be overwritten.",
|
||||
"%1 build directory")
|
||||
.arg(m_buildConfiguration->buildDirectory().toUserOutput()));
|
||||
return;
|
||||
} else if (incompatibleBuild) {
|
||||
setProblemLabel(shadowBuildWarning +tr("An incompatible build exists in %1, which will be overwritten.",
|
||||
"%1 build directory")
|
||||
setProblemLabel(tr("An incompatible build exists in %1, which will be overwritten.",
|
||||
"%1 build directory")
|
||||
.arg(m_buildConfiguration->buildDirectory().toUserOutput()));
|
||||
return;
|
||||
} else if (!shadowBuildWarning.isEmpty()) {
|
||||
setProblemLabel(shadowBuildWarning);
|
||||
return;
|
||||
}
|
||||
|
||||
setProblemLabel(QString());
|
||||
|
@@ -159,9 +159,6 @@ QString QMakeStep::allArguments(bool shorted)
|
||||
QString args = QtcProcess::joinArgs(arguments);
|
||||
// User arguments
|
||||
QtcProcess::addArgs(&args, m_userArgs);
|
||||
// moreArgumentsAfter
|
||||
foreach (const QString &arg, deducedArgumentsAfter())
|
||||
QtcProcess::addArg(&args, arg);
|
||||
return args;
|
||||
}
|
||||
|
||||
@@ -199,25 +196,6 @@ QStringList QMakeStep::deducedArguments()
|
||||
return arguments;
|
||||
}
|
||||
|
||||
/// -after OBJECTS_DIR, MOC_DIR, UI_DIR, RCC_DIR
|
||||
QStringList QMakeStep::deducedArgumentsAfter()
|
||||
{
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit());
|
||||
if (version && !version->supportsShadowBuilds()) {
|
||||
// We have a target which does not allow shadow building.
|
||||
// But we really don't want to have the build artefacts in the source dir
|
||||
// so we try to hack around it, to make the common cases work.
|
||||
// This is a HACK, remove once all make generators support
|
||||
// shadow building
|
||||
return QStringList() << QLatin1String("-after")
|
||||
<< QLatin1String("OBJECTS_DIR=obj")
|
||||
<< QLatin1String("MOC_DIR=moc")
|
||||
<< QLatin1String("UI_DIR=ui")
|
||||
<< QLatin1String("RCC_DIR=rcc");
|
||||
}
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
bool QMakeStep::init()
|
||||
{
|
||||
QmakeBuildConfiguration *qt4bc = qmakeBuildConfiguration();
|
||||
|
@@ -102,8 +102,6 @@ public:
|
||||
QString allArguments(bool shorted = false);
|
||||
// deduced arguments e.g. qmljs debugging
|
||||
QStringList deducedArguments();
|
||||
// deduced arguments with -after, e.g. OBJECTS_DIR for symbian
|
||||
QStringList deducedArgumentsAfter();
|
||||
// arguments passed to the pro file parser
|
||||
QStringList parserArguments();
|
||||
// arguments set by the user
|
||||
|
@@ -1202,11 +1202,6 @@ void BaseQtVersion::recheckDumper()
|
||||
m_versionInfoUpToDate = false;
|
||||
}
|
||||
|
||||
bool BaseQtVersion::supportsShadowBuilds() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
QList<Task> BaseQtVersion::reportIssuesImpl(const QString &proFile, const QString &buildDir) const
|
||||
{
|
||||
QList<Task> results;
|
||||
|
@@ -172,7 +172,6 @@ public:
|
||||
|
||||
virtual QmakeBuildConfigs defaultBuildConfig() const;
|
||||
virtual void recheckDumper();
|
||||
virtual bool supportsShadowBuilds() const;
|
||||
|
||||
/// Check a .pro-file/Qt version combination on possible issues
|
||||
/// @return a list of tasks, ordered on severity (errors first, then
|
||||
|
Reference in New Issue
Block a user