forked from qt-creator/qt-creator
CMake: Don't guess at build config when not needed
Change-Id: I0d7fb0a25103d2cf5bfb9b2d54bae18a91010c49 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -1441,7 +1441,7 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id)
|
|||||||
addAspect<BuildTypeAspect>();
|
addAspect<BuildTypeAspect>();
|
||||||
addAspect<QtSupport::QmlDebuggingAspect>(this);
|
addAspect<QtSupport::QmlDebuggingAspect>(this);
|
||||||
|
|
||||||
addAspect<ConfigureEnvironmentAspect>(target);
|
addAspect<ConfigureEnvironmentAspect>(this);
|
||||||
|
|
||||||
setInitialBuildAndCleanSteps(target);
|
setInitialBuildAndCleanSteps(target);
|
||||||
|
|
||||||
@@ -2254,8 +2254,9 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
ConfigureEnvironmentAspect::ConfigureEnvironmentAspect(ProjectExplorer::Target *target)
|
ConfigureEnvironmentAspect::ConfigureEnvironmentAspect(BuildConfiguration *bc)
|
||||||
{
|
{
|
||||||
|
Target *target = bc->target();
|
||||||
setIsLocal(true);
|
setIsLocal(true);
|
||||||
setAllowPrintOnRun(false);
|
setAllowPrintOnRun(false);
|
||||||
setConfigWidgetCreator(
|
setConfigWidgetCreator(
|
||||||
@@ -2268,14 +2269,8 @@ ConfigureEnvironmentAspect::ConfigureEnvironmentAspect(ProjectExplorer::Target *
|
|||||||
return device ? device->systemEnvironment() : Environment::systemEnvironment();
|
return device ? device->systemEnvironment() : Environment::systemEnvironment();
|
||||||
});
|
});
|
||||||
|
|
||||||
const int buildEnvIndex = addSupportedBaseEnvironment(Tr::tr("Build Environment"), [target] {
|
const int buildEnvIndex = addSupportedBaseEnvironment(Tr::tr("Build Environment"), [bc] {
|
||||||
Environment env;
|
return bc->environment();
|
||||||
if (BuildConfiguration *bc = target->activeBuildConfiguration()) {
|
|
||||||
env = bc->environment();
|
|
||||||
} else { // Fallback for targets without buildconfigurations:
|
|
||||||
env = target->kit()->buildEnvironment();
|
|
||||||
}
|
|
||||||
return env;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(target,
|
connect(target,
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ class ConfigureEnvironmentAspect final: public ProjectExplorer::EnvironmentAspec
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ConfigureEnvironmentAspect(ProjectExplorer::Target *target);
|
explicit ConfigureEnvironmentAspect(ProjectExplorer::BuildConfiguration *buildConfig);
|
||||||
|
|
||||||
void fromMap(const QVariantMap &map);
|
void fromMap(const QVariantMap &map);
|
||||||
void toMap(QVariantMap &map) const;
|
void toMap(QVariantMap &map) const;
|
||||||
|
|||||||
Reference in New Issue
Block a user