Skip to content

Commit

Permalink
enable parallel build in Visual Studio
Browse files Browse the repository at this point in the history
fixes #94
closes #487
  • Loading branch information
vasily-kirichenko authored and latkin committed Aug 12, 2015
1 parent cfae0cf commit 8d2fb0d
Showing 1 changed file with 1 addition and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1674,33 +1674,6 @@ public class BuildableProjectConfig : IVsBuildableProjectCfg
{

#if FX_ATLEAST_45
#if VS_VERSION_DEV12
private static string RegistryRoot = @"SOFTWARE\Microsoft\VisualStudio\12.0\";
#else
private static string RegistryRoot = @"SOFTWARE\Microsoft\VisualStudio\14.0\";
#endif
private static bool? isMultiThreadedBuildEnabled = null;
internal static bool IsMultiThreadedBuildEnabled()
{
if (!isMultiThreadedBuildEnabled.HasValue)
{
isMultiThreadedBuildEnabled = false;
string key = RegistryRoot + @"Projects\{f2a71f9b-5d33-465a-a702-920d77279786}";
using (RegistryKey subKey = Registry.LocalMachine.OpenSubKey(key))
{
if (subKey != null)
{
object valueAsObject = subKey.GetValue(@"IsMultiThreadedBuildEnabled"); // Note: VS caches the registry pretty aggressively, may need "devenv /setup" to pick up a changed value
if (valueAsObject != null && valueAsObject is string)
{
isMultiThreadedBuildEnabled = ((string)valueAsObject) == "1";
}
}
}
}
return isMultiThreadedBuildEnabled.Value;
}

private bool IsInProgress()
{
return buildManagerAccessor.IsInProgress();
Expand Down Expand Up @@ -1736,7 +1709,7 @@ public int GetBuildCfgProperty(int propid, out object pvar)
{
case VSBLDCFGPROPID_SupportsMTBuild:
// Indicate that we support multi-proc builds
pvar = IsMultiThreadedBuildEnabled();
pvar = true;
return VSConstants.S_OK;
default:
pvar = null;
Expand Down

0 comments on commit 8d2fb0d

Please sign in to comment.