IDE: compiler options: disable target platform for packages

git-svn-id: trunk@37628 -
This commit is contained in:
mattias 2012-06-11 20:09:55 +00:00
parent 286e5828d2
commit 9bd04cb451

View File

@ -8,7 +8,7 @@ uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
ExtCtrls, LCLProc,
DefineTemplates, IDEOptionsIntf, Project, CompilerOptions,
LazarusIDEStrConsts;
LazarusIDEStrConsts, PackageDefs;
type
@ -45,6 +45,8 @@ type
TargetCPUComboBox: TComboBox;
TargetOSComboBox: TComboBox;
TargetProcessorProcComboBox: TComboBox;
private
fIsPackage: boolean;
public
function GetTitle: string; override;
procedure Setup(ADialog: TAbstractOptionsEditorDialog); override;
@ -226,6 +228,7 @@ procedure TCompilerCodegenOptionsFrame.ReadSettings(AOptions: TAbstractIDEOption
var
i: longint;
begin
fIsPackage:=AOptions is TPkgCompilerOptions;
with AOptions as TBaseCompilerOptions do
begin
chkSmartLinkUnit.Checked := SmartLinkUnit;
@ -241,18 +244,28 @@ begin
edtHeapSize.Text := IntToStr(HeapSize);
edtStackSize.Text := IntToStr(StackSize);
i := TargetOSComboBox.Items.IndexOf(TargetOS);
if i < 0 then
i := 0; // 0 is default
TargetOSComboBox.ItemIndex := i;
TargetOSComboBox.Text := TargetOS;
i := TargetCPUComboBox.Items.IndexOf(TargetCPU);
if i < 0 then
i := 0; // 0 is default
TargetCPUComboBox.ItemIndex := i;
TargetCPUComboBox.Text := TargetCPU;
if fIsPackage then begin
grpTargetPlatform.Enabled:=false;
TargetOSComboBox.ItemIndex := 0;
TargetOSComboBox.Text := 'default';
TargetCPUComboBox.ItemIndex := 0;
TargetCPUComboBox.Text := 'default';
TargetProcessorProcComboBox.Text := 'default';
end else begin
grpTargetPlatform.Enabled:=true;
i := TargetOSComboBox.Items.IndexOf(TargetOS);
if i < 0 then
i := 0; // 0 is default
TargetOSComboBox.ItemIndex := i;
TargetOSComboBox.Text := TargetOS;
i := TargetCPUComboBox.Items.IndexOf(TargetCPU);
if i < 0 then
i := 0; // 0 is default
TargetCPUComboBox.ItemIndex := i;
TargetCPUComboBox.Text := TargetCPU;
TargetProcessorProcComboBox.Text := ProcessorToCaption(TargetProcessor);
TargetProcessorProcComboBox.Text := ProcessorToCaption(TargetProcessor);
end;
chkOptVarsInReg.Checked := VariablesInRegisters;
chkOptUncertain.Checked := UncertainOptimizations;
@ -297,17 +310,21 @@ begin
else
StackSize := hs;
NewTargetOS := TargetOSComboBox.Text;
if TargetOSComboBox.Items.IndexOf(NewTargetOS) <= 0 then
NewTargetOS := '';
TargetOS := CaptionToOS(NewTargetOS);
if not fIsPackage then
begin
NewTargetOS := TargetOSComboBox.Text;
if TargetOSComboBox.Items.IndexOf(NewTargetOS) <= 0 then
NewTargetOS := '';
TargetOS := CaptionToOS(NewTargetOS);
NewTargetCPU := TargetCPUComboBox.Text;
if TargetCPUComboBox.Items.IndexOf(NewTargetCPU) <= 0 then
NewTargetCPU := '';
TargetCPU := CaptionToCPU(NewTargetCPU);
NewTargetCPU := TargetCPUComboBox.Text;
if TargetCPUComboBox.Items.IndexOf(NewTargetCPU) <= 0 then
NewTargetCPU := '';
TargetCPU := CaptionToCPU(NewTargetCPU);
TargetProcessor := CaptionToProcessor(TargetProcessorProcComboBox.Text);
end;
TargetProcessor := CaptionToProcessor(TargetProcessorProcComboBox.Text);
VariablesInRegisters := chkOptVarsInReg.Checked;
UncertainOptimizations := chkOptUncertain.Checked;
SmallerCode := chkOptSmaller.Checked;