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('SrcOS2',S)=0)
or (SysUtils.CompareText('TargetCPU',S)=0)
or (SysUtils.CompareText('SubTarget',S)=0)
or (SysUtils.CompareText('LCLWidgetType',S)=0)
then begin
IDEMessageDialog(lisCCOErrorCaption,

View File

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

View File

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

View File

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