ide: added compiler option combobox SubTarget

This commit is contained in:
mattias 2023-07-26 11:41:37 +01:00
parent a3f455d604
commit d0a134acdc
4 changed files with 104 additions and 57 deletions

View File

@ -192,6 +192,7 @@ begin
or (SysUtils.CompareText('SrcOS',S)=0) or (SysUtils.CompareText('SrcOS',S)=0)
or (SysUtils.CompareText('SrcOS2',S)=0) or (SysUtils.CompareText('SrcOS2',S)=0)
or (SysUtils.CompareText('TargetCPU',S)=0) or (SysUtils.CompareText('TargetCPU',S)=0)
or (SysUtils.CompareText('SubTarget',S)=0)
or (SysUtils.CompareText('LCLWidgetType',S)=0) or (SysUtils.CompareText('LCLWidgetType',S)=0)
then begin then begin
IDEMessageDialog(lisCCOErrorCaption, IDEMessageDialog(lisCCOErrorCaption,

View File

@ -10,20 +10,20 @@ object CompilerConfigTargetFrame: TCompilerConfigTargetFrame
DesignTop = 284 DesignTop = 284
object grbConfigFile: TGroupBox object grbConfigFile: TGroupBox
Left = 0 Left = 0
Height = 102 Height = 101
Top = 0 Top = 0
Width = 594 Width = 594
Align = alTop Align = alTop
AutoSize = True AutoSize = True
Caption = 'grbConfigFile' Caption = 'grbConfigFile'
ClientHeight = 83 ClientHeight = 74
ClientWidth = 590 ClientWidth = 584
TabOrder = 0 TabOrder = 0
object chkConfigFile: TCheckBox object chkConfigFile: TCheckBox
Left = 6 Left = 6
Height = 21 Height = 18
Top = 6 Top = 6
Width = 578 Width = 572
Align = alTop Align = alTop
BorderSpacing.Left = 6 BorderSpacing.Left = 6
BorderSpacing.Top = 6 BorderSpacing.Top = 6
@ -33,9 +33,9 @@ object CompilerConfigTargetFrame: TCompilerConfigTargetFrame
end end
object chkCustomConfigFile: TCheckBox object chkCustomConfigFile: TCheckBox
Left = 6 Left = 6
Height = 21 Height = 18
Top = 30 Top = 27
Width = 578 Width = 572
Align = alTop Align = alTop
BorderSpacing.Left = 6 BorderSpacing.Left = 6
BorderSpacing.Top = 3 BorderSpacing.Top = 3
@ -51,9 +51,9 @@ object CompilerConfigTargetFrame: TCompilerConfigTargetFrame
AnchorSideRight.Control = chkCustomConfigFile AnchorSideRight.Control = chkCustomConfigFile
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 25 Left = 25
Height = 25 Height = 22
Top = 52 Top = 46
Width = 559 Width = 553
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 19 BorderSpacing.Left = 19
BorderSpacing.Top = 1 BorderSpacing.Top = 1
@ -65,24 +65,24 @@ object CompilerConfigTargetFrame: TCompilerConfigTargetFrame
object grbTargetPlatform: TGroupBox object grbTargetPlatform: TGroupBox
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 0 Left = 0
Height = 109 Height = 125
Top = 110 Top = 109
Width = 594 Width = 594
Align = alTop Align = alTop
AutoSize = True AutoSize = True
BorderSpacing.Top = 8 BorderSpacing.Top = 8
Caption = 'Target Platform' Caption = 'Target Platform'
ClientHeight = 90 ClientHeight = 98
ClientWidth = 590 ClientWidth = 584
TabOrder = 1 TabOrder = 1
object lblTargetOS: TLabel object lblTargetOS: TLabel
AnchorSideLeft.Control = grbTargetPlatform AnchorSideLeft.Control = grbTargetPlatform
AnchorSideTop.Control = TargetOSComboBox AnchorSideTop.Control = TargetOSComboBox
AnchorSideTop.Side = asrCenter AnchorSideTop.Side = asrCenter
Left = 6 Left = 6
Height = 15 Height = 16
Top = 8 Top = 5
Width = 70 Width = 71
BorderSpacing.Left = 6 BorderSpacing.Left = 6
Caption = 'lblTargetOS' Caption = 'lblTargetOS'
ParentColor = False ParentColor = False
@ -92,9 +92,9 @@ object CompilerConfigTargetFrame: TCompilerConfigTargetFrame
AnchorSideTop.Control = TargetCPUComboBox AnchorSideTop.Control = TargetCPUComboBox
AnchorSideTop.Side = asrCenter AnchorSideTop.Side = asrCenter
Left = 6 Left = 6
Height = 15 Height = 16
Top = 36 Top = 28
Width = 78 Width = 80
Caption = 'lblTargetCPU' Caption = 'lblTargetCPU'
ParentColor = False ParentColor = False
end end
@ -103,30 +103,42 @@ object CompilerConfigTargetFrame: TCompilerConfigTargetFrame
AnchorSideTop.Control = TargetProcComboBox AnchorSideTop.Control = TargetProcComboBox
AnchorSideTop.Side = asrCenter AnchorSideTop.Side = asrCenter
Left = 6 Left = 6
Height = 15 Height = 16
Top = 64 Top = 51
Width = 81 Width = 80
Caption = 'lblTargetProc' Caption = 'lblTargetProc'
ParentColor = False ParentColor = False
end end
object lblSubTarget: TLabel
AnchorSideLeft.Control = lblTargetCPU
AnchorSideTop.Control = SubTargetComboBox
AnchorSideTop.Side = asrCenter
Left = 6
Height = 16
Top = 74
Width = 75
Caption = 'lblSubTarget'
ParentColor = False
end
object TargetOSComboBox: TComboBox object TargetOSComboBox: TComboBox
AnchorSideLeft.Control = lblTargetOS AnchorSideLeft.Control = lblTargetOS
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = grbTargetPlatform AnchorSideTop.Control = grbTargetPlatform
AnchorSideRight.Control = grbTargetPlatform AnchorSideRight.Control = grbTargetPlatform
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 82 Left = 83
Height = 25 Height = 20
Top = 3 Top = 3
Width = 502 Width = 495
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6 BorderSpacing.Left = 6
BorderSpacing.Top = 3 BorderSpacing.Top = 3
BorderSpacing.Right = 6 BorderSpacing.Right = 6
ItemHeight = 0 ItemHeight = 26
OnSelect = TargetOSComboBoxSelect OnSelect = TargetOSComboBoxSelect
Style = csDropDownList Style = csDropDownList
TabOrder = 0 TabOrder = 0
Text = '0'
end end
object TargetCPUComboBox: TComboBox object TargetCPUComboBox: TComboBox
AnchorSideLeft.Control = lblTargetCPU AnchorSideLeft.Control = lblTargetCPU
@ -135,18 +147,19 @@ object CompilerConfigTargetFrame: TCompilerConfigTargetFrame
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = grbTargetPlatform AnchorSideRight.Control = grbTargetPlatform
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 90 Left = 92
Height = 25 Height = 20
Top = 31 Top = 26
Width = 494 Width = 486
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6 BorderSpacing.Left = 6
BorderSpacing.Top = 3 BorderSpacing.Top = 3
BorderSpacing.Right = 6 BorderSpacing.Right = 6
ItemHeight = 0 ItemHeight = 26
OnSelect = TargetCPUComboBoxSelect OnSelect = TargetCPUComboBoxSelect
Style = csDropDownList Style = csDropDownList
TabOrder = 1 TabOrder = 1
Text = '0'
end end
object TargetProcComboBox: TComboBox object TargetProcComboBox: TComboBox
AnchorSideLeft.Control = lblTargetProc AnchorSideLeft.Control = lblTargetProc
@ -155,37 +168,58 @@ object CompilerConfigTargetFrame: TCompilerConfigTargetFrame
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = grbTargetPlatform AnchorSideRight.Control = grbTargetPlatform
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 93 Left = 92
Height = 25 Height = 20
Top = 59 Top = 49
Width = 486
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
BorderSpacing.Top = 3
BorderSpacing.Right = 6
BorderSpacing.Bottom = 3
ItemHeight = 26
Style = csDropDownList
TabOrder = 3
Text = '0'
end
object SubTargetComboBox: TComboBox
AnchorSideLeft.Control = lblSubTarget
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = TargetProcComboBox
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = grbTargetPlatform
AnchorSideRight.Side = asrBottom
Left = 87
Height = 20
Top = 72
Width = 491 Width = 491
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6 BorderSpacing.Left = 6
BorderSpacing.Top = 3 BorderSpacing.Top = 3
BorderSpacing.Right = 6 BorderSpacing.Right = 6
BorderSpacing.Bottom = 6 BorderSpacing.Bottom = 6
ItemHeight = 0 ItemHeight = 19
Style = csDropDownList
TabOrder = 2 TabOrder = 2
Text = '0'
end end
end end
object grbTargetOptions: TGroupBox object grbTargetOptions: TGroupBox
Left = 0 Left = 0
Height = 57 Height = 57
Top = 227 Top = 242
Width = 594 Width = 594
Align = alTop Align = alTop
AutoSize = True AutoSize = True
BorderSpacing.Top = 8 BorderSpacing.Top = 8
Caption = 'Target-specific options' Caption = 'Target-specific options'
ClientHeight = 38 ClientHeight = 30
ClientWidth = 590 ClientWidth = 584
TabOrder = 2 TabOrder = 2
object chkWin32GraphicApp: TCheckBox object chkWin32GraphicApp: TCheckBox
Left = 6 Left = 6
Height = 21 Height = 18
Top = 6 Top = 6
Width = 578 Width = 572
Align = alTop Align = alTop
BorderSpacing.Around = 6 BorderSpacing.Around = 6
Caption = 'chkWin32GraphicApp' Caption = 'chkWin32GraphicApp'
@ -196,9 +230,9 @@ object CompilerConfigTargetFrame: TCompilerConfigTargetFrame
AnchorSideTop.Control = CurrentWidgetTypeLabel AnchorSideTop.Control = CurrentWidgetTypeLabel
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 16 Left = 16
Height = 20 Height = 16
Top = 350 Top = 327
Width = 140 Width = 128
BorderSpacing.Top = 3 BorderSpacing.Top = 3
Caption = 'LCLWidgetTypeLabel' Caption = 'LCLWidgetTypeLabel'
Font.Color = clBlue Font.Color = clBlue
@ -212,9 +246,9 @@ object CompilerConfigTargetFrame: TCompilerConfigTargetFrame
AnchorSideTop.Control = grbTargetOptions AnchorSideTop.Control = grbTargetOptions
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 3 Left = 3
Height = 20 Height = 16
Top = 327 Top = 308
Width = 165 Width = 151
BorderSpacing.Top = 9 BorderSpacing.Top = 9
Caption = 'CurrentWidgetTypeLabel' Caption = 'CurrentWidgetTypeLabel'
ParentColor = False ParentColor = False

View File

@ -36,10 +36,10 @@ uses
// CodeTools // CodeTools
DefineTemplates, DefineTemplates,
// IdeIntf // IdeIntf
IDEOptionsIntf, IDEOptEditorIntf, MacroIntf, IDEDialogs, IDEOptionsIntf, IDEOptEditorIntf, MacroIntf, IDEDialogs, IDEUtils,
// IDE // IDE
CompilerOptions, LazarusIDEStrConsts, TransferMacros, PackageDefs, Project, CompilerOptions, LazarusIDEStrConsts, TransferMacros, PackageDefs, Project,
compiler_parsing_options; RecentListProcs, InputHistory, compiler_parsing_options;
type type
@ -57,10 +57,12 @@ type
lblTargetCPU: TLabel; lblTargetCPU: TLabel;
lblTargetOS: TLabel; lblTargetOS: TLabel;
lblTargetProc: TLabel; lblTargetProc: TLabel;
lblSubTarget: TLabel;
LCLWidgetTypeLabel: TLabel; LCLWidgetTypeLabel: TLabel;
TargetCPUComboBox: TComboBox; TargetCPUComboBox: TComboBox;
TargetOSComboBox: TComboBox; TargetOSComboBox: TComboBox;
TargetProcComboBox: TComboBox; TargetProcComboBox: TComboBox;
SubTargetComboBox: TComboBox;
procedure chkCustomConfigFileClick(Sender: TObject); procedure chkCustomConfigFileClick(Sender: TObject);
procedure TargetOSComboBoxSelect(Sender: TObject); procedure TargetOSComboBoxSelect(Sender: TObject);
procedure TargetCPUComboBoxSelect(Sender: TObject); procedure TargetCPUComboBoxSelect(Sender: TObject);
@ -300,13 +302,16 @@ begin
ItemIndex := 0; ItemIndex := 0;
end; end;
// Target CPU // Target processor
lblTargetProc.Caption := dlgTargetProc+' (-Cp)'; lblTargetProc.Caption := dlgTargetProc+' (-Cp)';
// Target-specific options // Target-specific options
grbTargetOptions.Caption := dlgTargetSpecificOptions; grbTargetOptions.Caption := dlgTargetSpecificOptions;
chkWin32GraphicApp.Caption := dlgWin32GUIApp + ' (-WG)'; chkWin32GraphicApp.Caption := dlgWin32GUIApp + ' (-WG)';
// WidgetSet // WidgetSet
LCLWidgetTypeLabel.Caption := lisSelectAnotherLCLWidgetSet; LCLWidgetTypeLabel.Caption := lisSelectAnotherLCLWidgetSet;
// SubTarget
lblSubTarget.Caption := lisSubTarget+' (-t)';
finally finally
List.Free; List.Free;
end; end;
@ -334,6 +339,7 @@ begin
TargetCPUComboBox.ItemIndex := 0; TargetCPUComboBox.ItemIndex := 0;
TargetCPUComboBox.Text := 'default'; TargetCPUComboBox.Text := 'default';
TargetProcComboBox.Text := 'default'; TargetProcComboBox.Text := 'default';
SubTargetComboBox.Text := 'default';
CurrentWidgetTypeLabel.Visible:=false; CurrentWidgetTypeLabel.Visible:=false;
LCLWidgetTypeLabel.Visible:=false; LCLWidgetTypeLabel.Visible:=false;
end else begin end else begin
@ -352,6 +358,12 @@ begin
UpdateByTargetCPU(TargetCPU); UpdateByTargetCPU(TargetCPU);
UpdateByTargetOS(TargetOS); UpdateByTargetOS(TargetOS);
TargetProcComboBox.Text := ProcessorToCaption(TargetProcessor); TargetProcComboBox.Text := ProcessorToCaption(TargetProcessor);
with SubTargetComboBox do begin
Items.BeginUpdate;
Items.Assign(InputHistories.HistoryLists.GetList('SubTarget',true,rltCaseInsensitive));
SetComboBoxText(SubTargetComboBox,SubTarget,cstCaseInsensitive);
Items.EndUpdate;
end;
PkgDep:=TProjectCompilerOptions(AOptions).LazProject.FindDependencyByName('LCL'); PkgDep:=TProjectCompilerOptions(AOptions).LazProject.FindDependencyByName('LCL');
CurrentWidgetTypeLabel.Visible:=Assigned(PkgDep); CurrentWidgetTypeLabel.Visible:=Assigned(PkgDep);
LCLWidgetTypeLabel.Visible:=Assigned(PkgDep); LCLWidgetTypeLabel.Visible:=Assigned(PkgDep);
@ -387,6 +399,7 @@ begin
NewTargetCPU := ''; NewTargetCPU := '';
TargetCPU := CaptionToCPU(NewTargetCPU); TargetCPU := CaptionToCPU(NewTargetCPU);
TargetProcessor := CaptionToProcessor(TargetProcComboBox.Text); TargetProcessor := CaptionToProcessor(TargetProcComboBox.Text);
SubTarget := lowercase(SubTargetComboBox.Text);
end; end;
Win32GraphicApp := chkWin32GraphicApp.Checked; Win32GraphicApp := chkWin32GraphicApp.Checked;
end; end;

View File

@ -508,11 +508,10 @@ begin
Width := Height; Width := Height;
AssociatedEdit := OtherUnitsEdit; AssociatedEdit := OtherUnitsEdit;
ContextCaption := OtherUnitsLabel.Caption; ContextCaption := OtherUnitsLabel.Caption;
Templates:='$(LazarusDir)/lcl/units/$(TargetCPU)-$(TargetOS)' + Templates:='$(LazarusDir)/lcl/units/$(TargetCPU)-$(TargetOS)'
';$(LazarusDir)/lcl/units/$(TargetCPU)-$(TargetOS)/$(LCLWidgetType)' + +';$(LazarusDir)/lcl/units/$(TargetCPU)-$(TargetOS)/$(LCLWidgetType)'
';$(LazarusDir)/components/codetools/units/$(TargetCPU)-$(TargetOS)' + +';$(LazarusDir)/components/yourpkg/units/$(TargetCPU)-$(TargetOS)'
';$(LazarusDir)/components/custom' + +';$(LazarusDir)/components/yourpkg/units/$(TargetCPU)-$(TargetOS)-$(SubTarget)';
';$(LazarusDir)/packager/units/$(TargetCPU)-$(TargetOS)';
OnClick := @PathEditBtnClick; OnClick := @PathEditBtnClick;
OnExecuted := @PathEditBtnExecuted; OnExecuted := @PathEditBtnExecuted;
end; end;