Browse Source

Can now specify target CPU when compiling Python applications.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@3743 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Matt Ward 17 years ago
parent
commit
c11c8658f9
  1. 33
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Resources/CompilingOptionsPanel.xfrm
  2. 11
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/CompilingOptionsPanel.cs
  3. 12
      src/AddIns/BackendBindings/Python/PythonBinding/Test/CompilingOptionsPanelTestFixture.cs
  4. 14
      src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/DerivedCompilingOptionsPanel.cs
  5. 11
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/AbstractBuildOptions.cs

33
src/AddIns/BackendBindings/Python/PythonBinding/Project/Resources/CompilingOptionsPanel.xfrm

@ -8,17 +8,34 @@ @@ -8,17 +8,34 @@
<Location value="3, -2" />
<UseCompatibleTextRendering value="True" />
<Text value="${res:Dialog.ProjectOptions.Build.Output}" />
<Anchor value="Top, Left, Right" />
<Size value="504, 362" />
<Anchor value="Top, Left, Right" />
<TabIndex value="2" />
<Controls>
<System.Windows.Forms.ComboBox>
<Name value="targetCpuComboBox" />
<TabIndex value="14" />
<Location value="12, 106" />
<Size value="180, 21" />
<FormattingEnabled value="True" />
<DropDownStyle value="DropDownList" />
</System.Windows.Forms.ComboBox>
<System.Windows.Forms.Label>
<Name value="targetCpuLabel" />
<Location value="12, 87" />
<UseCompatibleTextRendering value="True" />
<Text value="${res:Dialog.ProjectOptions.Build.TargetCPU}" />
<Size value="180, 16" />
<TextAlign value="MiddleLeft" />
<TabIndex value="13" />
</System.Windows.Forms.Label>
<System.Windows.Forms.CheckBox>
<Name value="debugInfoCheckBox" />
<CheckAlign value="MiddleRight" />
<Location value="12, 63" />
<Text value="Debug info:" />
<Text value="${res:Dialog.ProjectOptions.Build.DebugInfo}" />
<TabIndex value="12" />
<Size value="147, 21" />
<Size value="180, 21" />
<UseCompatibleTextRendering value="True" />
</System.Windows.Forms.CheckBox>
<System.Windows.Forms.Label>
@ -26,29 +43,29 @@ @@ -26,29 +43,29 @@
<Location value="12, 17" />
<UseCompatibleTextRendering value="True" />
<Text value="${res:Dialog.ProjectOptions.Build.OutputPath}" />
<Anchor value="Top, Left, Right" />
<TextAlign value="BottomLeft" />
<Size value="492, 16" />
<TextAlign value="BottomLeft" />
<Anchor value="Top, Left, Right" />
<TabIndex value="3" />
</System.Windows.Forms.Label>
<System.Windows.Forms.TextBox>
<Name value="outputPathTextBox" />
<TabIndex value="4" />
<Size value="448, 20" />
<Location value="12, 37" />
<Anchor value="Top, Left, Right" />
<Size value="448, 20" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.Button>
<Name value="outputPathBrowseButton" />
<Location value="464, 37" />
<UseCompatibleTextRendering value="True" />
<Text value="..." />
<Anchor value="Top, Right" />
<Size value="40, 21" />
<Anchor value="Top, Right" />
<TabIndex value="5" />
</System.Windows.Forms.Button>
</Controls>
</System.Windows.Forms.GroupBox>
</Controls>
</System.Windows.Forms.UserControl>
</Components>
</Components>

11
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/CompilingOptionsPanel.cs

@ -28,6 +28,9 @@ namespace ICSharpCode.PythonBinding @@ -28,6 +28,9 @@ namespace ICSharpCode.PythonBinding
b = BindBoolean("debugInfoCheckBox", "DebugInfo", false);
CreateLocationButton(b, "debugInfoCheckBox");
b = CreatePlatformTargetComboBox();
CreateLocationButton(b, "targetCpuComboBox");
AddConfigurationSelector(this);
}
@ -82,5 +85,13 @@ namespace ICSharpCode.PythonBinding @@ -82,5 +85,13 @@ namespace ICSharpCode.PythonBinding
{
helper.AddConfigurationSelector(control);
}
/// <summary>
/// Creates the platform target combo box.
/// </summary>
protected virtual ConfigurationGuiBinding CreatePlatformTargetComboBox()
{
return base.CreatePlatformTarget();
}
}
}

12
src/AddIns/BackendBindings/Python/PythonBinding/Test/CompilingOptionsPanelTestFixture.cs

@ -117,6 +117,18 @@ namespace PythonBinding.Tests @@ -117,6 +117,18 @@ namespace PythonBinding.Tests
Assert.IsTrue(compilingOptionsPanel.ConfigurationSelectorAddedToControl);
}
[Test]
public void TargetCpuComboxBoxAdded()
{
Assert.IsTrue(compilingOptionsPanel.IsTargetCpuComboBoxCreated);
}
[Test]
public void TargetCpuComboxBoxLocationButtonCreated()
{
Assert.IsTrue(compilingOptionsPanel.IsLocationButtonCreated("targetCpuComboBox"));
}
BrowseFolderButtonInfo GetOutputPathBrowseFolderInfo()
{
return compilingOptionsPanel.GetBrowseFolderButtonInfo("outputPathBrowseButton");

14
src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/DerivedCompilingOptionsPanel.cs

@ -28,6 +28,7 @@ namespace PythonBinding.Tests.Utils @@ -28,6 +28,7 @@ namespace PythonBinding.Tests.Utils
Dictionary<string, TextBoxEditMode> boundTextEditModes = new Dictionary<string, TextBoxEditMode>();
List<string> locationButtonsCreated = new List<string>();
Dictionary<string, BrowseFolderButtonInfo> browseFolderButtons = new Dictionary<string, BrowseFolderButtonInfo>();
bool createdTargetCpuComboBox;
public DerivedCompilingOptionsPanel()
{
@ -45,6 +46,13 @@ namespace PythonBinding.Tests.Utils @@ -45,6 +46,13 @@ namespace PythonBinding.Tests.Utils
get { return setupFromManifestResourceName; }
}
/// <summary>
/// Returns whether the target cpu combo box was created.
/// </summary>
public bool IsTargetCpuComboBoxCreated {
get { return createdTargetCpuComboBox; }
}
/// <summary>
/// Gets the name of the control that was bound to the specified
/// property.
@ -142,6 +150,12 @@ namespace PythonBinding.Tests.Utils @@ -142,6 +150,12 @@ namespace PythonBinding.Tests.Utils
return base.CreateLocationButton(binding, controlName);
}
protected override ConfigurationGuiBinding CreatePlatformTargetComboBox()
{
createdTargetCpuComboBox = true;
return base.CreatePlatformTargetComboBox();
}
/// <summary>
/// Connects the browse folder button control to the target control.
/// </summary>

11
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/AbstractBuildOptions.cs

@ -197,6 +197,13 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -197,6 +197,13 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
b.DefaultLocation = PropertyStorageLocations.PlatformSpecific;
b.RegisterLocationButton(advancedLocationButton);
b = CreatePlatformTarget();
b.RegisterLocationButton(advancedLocationButton);
}
protected ConfigurationGuiBinding CreatePlatformTarget()
{
ConfigurationGuiBinding b;
b = helper.BindStringEnum("targetCpuComboBox", "PlatformTarget",
"AnyCPU",
new StringPair("AnyCPU", "${res:Dialog.ProjectOptions.Build.TargetCPU.Any}"),
@ -204,9 +211,9 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -204,9 +211,9 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
new StringPair("x64", "${res:Dialog.ProjectOptions.Build.TargetCPU.x64}"),
new StringPair("Itanium", "${res:Dialog.ProjectOptions.Build.TargetCPU.Itanium}"));
b.DefaultLocation = PropertyStorageLocations.PlatformSpecific;
b.RegisterLocationButton(advancedLocationButton);
return b;
}
void DebugSymbolsLoaded(object sender, EventArgs e)
{
PropertyStorageLocations location;

Loading…
Cancel
Save