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<QtSupport::QmlDebuggingAspect>(this);
|
||||
|
||||
addAspect<ConfigureEnvironmentAspect>(target);
|
||||
addAspect<ConfigureEnvironmentAspect>(this);
|
||||
|
||||
setInitialBuildAndCleanSteps(target);
|
||||
|
||||
@@ -2254,8 +2254,9 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
ConfigureEnvironmentAspect::ConfigureEnvironmentAspect(ProjectExplorer::Target *target)
|
||||
ConfigureEnvironmentAspect::ConfigureEnvironmentAspect(BuildConfiguration *bc)
|
||||
{
|
||||
Target *target = bc->target();
|
||||
setIsLocal(true);
|
||||
setAllowPrintOnRun(false);
|
||||
setConfigWidgetCreator(
|
||||
@@ -2268,14 +2269,8 @@ ConfigureEnvironmentAspect::ConfigureEnvironmentAspect(ProjectExplorer::Target *
|
||||
return device ? device->systemEnvironment() : Environment::systemEnvironment();
|
||||
});
|
||||
|
||||
const int buildEnvIndex = addSupportedBaseEnvironment(Tr::tr("Build Environment"), [target] {
|
||||
Environment env;
|
||||
if (BuildConfiguration *bc = target->activeBuildConfiguration()) {
|
||||
env = bc->environment();
|
||||
} else { // Fallback for targets without buildconfigurations:
|
||||
env = target->kit()->buildEnvironment();
|
||||
}
|
||||
return env;
|
||||
const int buildEnvIndex = addSupportedBaseEnvironment(Tr::tr("Build Environment"), [bc] {
|
||||
return bc->environment();
|
||||
});
|
||||
|
||||
connect(target,
|
||||
|
||||
@@ -142,7 +142,7 @@ class ConfigureEnvironmentAspect final: public ProjectExplorer::EnvironmentAspec
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ConfigureEnvironmentAspect(ProjectExplorer::Target *target);
|
||||
explicit ConfigureEnvironmentAspect(ProjectExplorer::BuildConfiguration *buildConfig);
|
||||
|
||||
void fromMap(const QVariantMap &map);
|
||||
void toMap(QVariantMap &map) const;
|
||||
|
||||
Reference in New Issue
Block a user