aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiguel Costa <miguel.costa@qt.io>2018-03-21 17:20:29 +0100
committerMiguel Costa <miguel.costa@qt.io>2018-03-23 09:54:57 +0000
commitef0cf3b7ce3d4ce3cf9ccbf6384e0c9a7d7a2673 (patch)
tree0b4d74cd8dbce48c350cea5c739f8cbfe381efed
parent88ad85630d20e7f670c174d36886f38ed3635774 (diff)
Fix delay when starting to build large solution
When a project build is started, setting up the Qt environment no longer defines the LocalDebuggerEnvironment property. This property is not relevant for building the project and its definition was causing a noticeable delay in solutions with many projects and configurations. Task-number: QTVSADDINBUG-520 Change-Id: Id798e564ca2cc97363f2f1576baa9269b7fb8b25 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r--src/qtprojectlib/QtProject.cs23
-rw-r--r--src/qtvstools/DteEventsHandler.cs2
2 files changed, 14 insertions, 11 deletions
diff --git a/src/qtprojectlib/QtProject.cs b/src/qtprojectlib/QtProject.cs
index 0b934fe2..aedde634 100644
--- a/src/qtprojectlib/QtProject.cs
+++ b/src/qtprojectlib/QtProject.cs
@@ -3298,7 +3298,7 @@ namespace QtProjectLib
/// <summary>
/// Sets the Qt environment for the given Qt version.
/// </summary>
- public void SetQtEnvironment(string qtVersion, string solutionConfig)
+ public void SetQtEnvironment(string qtVersion, string solutionConfig, bool build = false)
{
if (string.IsNullOrEmpty(qtVersion))
return;
@@ -3334,16 +3334,19 @@ namespace QtProjectLib
// will be stored in the .user file before the QTDIR property, which is an
// error because there is a dependency. To work around this, first remove
// the property and then add it after QTDIR is defined.
- string debuggerEnv = propertyAccess.GetPropertyValue(
- "LocalDebuggerEnvironment", cur_solution, "UserFile");
- if (!string.IsNullOrEmpty(debuggerEnv)) {
- var debugSettings = conf.DebugSettings as VCDebugSettings;
- if (debugSettings != null) {
- //Get original value without expanded properties
- debuggerEnv = debugSettings.Environment;
- }
- propertyAccess.RemoveProperty(
+ var debuggerEnv = string.Empty;
+ if (!build) {
+ debuggerEnv = propertyAccess.GetPropertyValue(
"LocalDebuggerEnvironment", cur_solution, "UserFile");
+ if (!string.IsNullOrEmpty(debuggerEnv)) {
+ var debugSettings = conf.DebugSettings as VCDebugSettings;
+ if (debugSettings != null) {
+ //Get original value without expanded properties
+ debuggerEnv = debugSettings.Environment;
+ }
+ propertyAccess.RemoveProperty(
+ "LocalDebuggerEnvironment", cur_solution, "UserFile");
+ }
}
propertyAccess.SetPropertyValue("QTDIR", cur_solution, "UserFile", qtDir);
if (!string.IsNullOrEmpty(debuggerEnv))
diff --git a/src/qtvstools/DteEventsHandler.cs b/src/qtvstools/DteEventsHandler.cs
index d5c7c328..719b58b8 100644
--- a/src/qtvstools/DteEventsHandler.cs
+++ b/src/qtvstools/DteEventsHandler.cs
@@ -233,7 +233,7 @@ namespace QtVsTools
// Solution config is given to function to get QTDIR property
// set correctly also during batch build
- qtpro.SetQtEnvironment(qtVersion, solutionConfig);
+ qtpro.SetQtEnvironment(qtVersion, solutionConfig, true);
if (QtVSIPSettings.GetLUpdateOnBuild(project))
Translation.RunlUpdate(project);
}