Browse Source

Create new projects as x86 by default - AnyCPU leads to programs running as 64-bit process without ever being tested that way.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@4810 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 16 years ago
parent
commit
511a9016f8
  1. 2
      src/Libraries/NRefactory/NRefactoryASTGenerator/NRefactoryASTGenerator.csproj
  2. 1
      src/Main/Base/Project/Src/Project/CompilableProject.cs
  3. 13
      src/Main/Base/Project/Src/Project/MSBuildBasedProject.cs
  4. 31
      src/Main/Base/Project/Src/Project/Solution/Solution.cs

2
src/Libraries/NRefactory/NRefactoryASTGenerator/NRefactoryASTGenerator.csproj

@ -59,4 +59,4 @@ @@ -59,4 +59,4 @@
<Folder Include="AST" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
</Project>
</Project>

1
src/Main/Base/Project/Src/Project/CompilableProject.cs

@ -88,6 +88,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -88,6 +88,7 @@ namespace ICSharpCode.SharpDevelop.Project
PropertyStorageLocations.ConfigurationSpecific, true);
SetProperty("Release", null, "OutputPath", @"bin\Release\",
PropertyStorageLocations.ConfigurationSpecific, true);
InvalidateConfigurationPlatformNames();
SetProperty("Debug", null, "DebugSymbols", "True",
PropertyStorageLocations.ConfigurationSpecific, true);

13
src/Main/Base/Project/Src/Project/MSBuildBasedProject.cs

@ -167,10 +167,11 @@ namespace ICSharpCode.SharpDevelop.Project @@ -167,10 +167,11 @@ namespace ICSharpCode.SharpDevelop.Project
MSBuild.BuildPropertyGroup group = project.AddNewPropertyGroup(false);
group.AddNewProperty(ProjectGuidPropertyName, IdGuid, true);
group.AddNewProperty("Configuration", "Debug", true).Condition = " '$(Configuration)' == '' ";
group.AddNewProperty("Platform", "AnyCPU", true).Condition = " '$(Platform)' == '' ";
group.AddNewProperty("Platform", "x86", true).Condition = " '$(Platform)' == '' ";
this.ActiveConfiguration = "Debug";
this.ActivePlatform = "AnyCPU";
this.ActivePlatform = "x86";
SetProperty(null, "x86", "PlatformTarget", "x86", PropertyStorageLocations.PlatformSpecific, false);
}
/// <summary>
@ -1135,6 +1136,14 @@ namespace ICSharpCode.SharpDevelop.Project @@ -1135,6 +1136,14 @@ namespace ICSharpCode.SharpDevelop.Project
}
}
protected void InvalidateConfigurationPlatformNames()
{
lock (SyncRoot) {
configurationNames = null;
platformNames = null;
}
}
/// <summary>
/// Load available configurations and platforms from the project file
/// by looking at which conditions are used.

31
src/Main/Base/Project/Src/Project/Solution/Solution.cs

@ -252,8 +252,35 @@ namespace ICSharpCode.SharpDevelop.Project @@ -252,8 +252,35 @@ namespace ICSharpCode.SharpDevelop.Project
public override void AddFolder(ISolutionFolder folder)
{
IProject project = folder as IProject;
if (project != null) {
if (this.GetConfigurationNames().Count == 0) {
foreach (string config in project.ConfigurationNames) {
foreach (string platform in project.PlatformNames)
AddSolutionConfigurationPlatform(config, FixPlatformNameForSolution(platform), null, false, false);
}
}
}
base.AddFolder(folder);
guidDictionary[folder.IdGuid] = folder;
if (project != null) {
var projectConfigurations = project.ConfigurationNames;
var solutionConfigurations = this.GetConfigurationNames();
var projectPlatforms = project.PlatformNames;
var solutionPlatforms = this.GetPlatformNames();
foreach (string config in solutionConfigurations) {
string projectConfig = config;
if (!projectConfigurations.Contains(projectConfig))
projectConfig = projectConfigurations.FirstOrDefault() ?? "Debug";
foreach (string platform in solutionPlatforms) {
string projectPlatform = FixPlatformNameForProject(platform);
if (!projectPlatforms.Contains(projectPlatform))
projectPlatform = projectPlatforms.FirstOrDefault() ?? "AnyCPU";
CreateMatchingItem(config, platform, project, projectConfig + "|" + FixPlatformNameForSolution(projectPlatform));
}
}
}
}
#endregion
@ -577,6 +604,8 @@ namespace ICSharpCode.SharpDevelop.Project @@ -577,6 +604,8 @@ namespace ICSharpCode.SharpDevelop.Project
}
ProjectSection newSec = new ProjectSection("SolutionConfigurationPlatforms", "preSolution");
this.Sections.Insert(0, newSec);
// convert VS 2003 solution to VS 2005 (or later)
foreach (ProjectSection sec in this.Sections) {
if (sec.Name == "SolutionConfiguration") {
this.Sections.Remove(sec);
@ -584,7 +613,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -584,7 +613,7 @@ namespace ICSharpCode.SharpDevelop.Project
// item.Name = item.Location
// might be ConfigName.0 = Debug (VS.NET)
// or Debug = Debug (VS.NET 03)
newSec.Items.Add(new SolutionItem(item.Location + "|Any CPU", item.Location + "|Any CPU"));
newSec.Items.Add(new SolutionItem(item.Location + "|x86", item.Location + "|x86"));
}
break;
}

Loading…
Cancel
Save