mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 09:59:23 +02:00
IDE: auto fix case of TargetOS and TargetCPU
git-svn-id: trunk@27847 -
This commit is contained in:
parent
e00ff67049
commit
2c5c4c2609
@ -889,6 +889,8 @@ procedure SplitLazarusCPUOSWidgetCombo(const Combination: string;
|
|||||||
function GetCompiledTargetOS: string;
|
function GetCompiledTargetOS: string;
|
||||||
function GetCompiledTargetCPU: string;
|
function GetCompiledTargetCPU: string;
|
||||||
function GetDefaultCompilerFilename(const TargetCPU: string = ''): string;
|
function GetDefaultCompilerFilename(const TargetCPU: string = ''): string;
|
||||||
|
function GetFPCTargetOS(TargetOS: string): string;
|
||||||
|
function GetFPCTargetCPU(TargetCPU: string): string;
|
||||||
|
|
||||||
// functions to quickly setup some defines
|
// functions to quickly setup some defines
|
||||||
function CreateDefinesInDirectories(const SourcePaths, FlagName: string
|
function CreateDefinesInDirectories(const SourcePaths, FlagName: string
|
||||||
@ -2565,6 +2567,16 @@ begin
|
|||||||
Result:=Result+ExeExt;
|
Result:=Result+ExeExt;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function GetFPCTargetOS(TargetOS: string): string;
|
||||||
|
begin
|
||||||
|
Result:=lowercase(TargetOS);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function GetFPCTargetCPU(TargetCPU: string): string;
|
||||||
|
begin
|
||||||
|
Result:=LowerCase(TargetCPU);
|
||||||
|
end;
|
||||||
|
|
||||||
function CreateDefinesInDirectories(const SourcePaths, FlagName: string
|
function CreateDefinesInDirectories(const SourcePaths, FlagName: string
|
||||||
): TDefineTemplate;
|
): TDefineTemplate;
|
||||||
var
|
var
|
||||||
|
@ -1222,9 +1222,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TBaseCompilerOptions.SetTargetCPU(const AValue: string);
|
procedure TBaseCompilerOptions.SetTargetCPU(const AValue: string);
|
||||||
|
var
|
||||||
|
NewValue: String;
|
||||||
begin
|
begin
|
||||||
if fTargetCPU=AValue then exit;
|
NewValue:=GetFPCTargetCPU(AValue);
|
||||||
fTargetCPU:=AValue;
|
if fTargetCPU=NewValue then exit;
|
||||||
|
fTargetCPU:=NewValue;
|
||||||
if ParsedOpts.InvalidateParseOnChange then
|
if ParsedOpts.InvalidateParseOnChange then
|
||||||
IncreaseBuildMacroChangeStamp;
|
IncreaseBuildMacroChangeStamp;
|
||||||
IncreaseChangeStamp;
|
IncreaseChangeStamp;
|
||||||
@ -1240,9 +1243,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TBaseCompilerOptions.SetTargetOS(const AValue: string);
|
procedure TBaseCompilerOptions.SetTargetOS(const AValue: string);
|
||||||
|
var
|
||||||
|
NewValue: String;
|
||||||
begin
|
begin
|
||||||
if fTargetOS=AValue then exit;
|
NewValue:=GetFPCTargetOS(AValue);
|
||||||
fTargetOS:=AValue;
|
if fTargetOS=NewValue then exit;
|
||||||
|
fTargetOS:=NewValue;
|
||||||
if ParsedOpts.InvalidateParseOnChange then
|
if ParsedOpts.InvalidateParseOnChange then
|
||||||
IncreaseBuildMacroChangeStamp;
|
IncreaseBuildMacroChangeStamp;
|
||||||
IncreaseChangeStamp;
|
IncreaseChangeStamp;
|
||||||
@ -1509,10 +1515,10 @@ begin
|
|||||||
end else
|
end else
|
||||||
TargetProcessor := aXMLConfig.GetValue(p+'TargetProcessor/Value', '');
|
TargetProcessor := aXMLConfig.GetValue(p+'TargetProcessor/Value', '');
|
||||||
TargetCPU := aXMLConfig.GetValue(p+'TargetCPU/Value', '');
|
TargetCPU := aXMLConfig.GetValue(p+'TargetCPU/Value', '');
|
||||||
|
TargetOS := aXMLConfig.GetValue(p+'TargetOS/Value', '');
|
||||||
VariablesInRegisters := aXMLConfig.GetValue(p+'Optimizations/VariablesInRegisters/Value', false);
|
VariablesInRegisters := aXMLConfig.GetValue(p+'Optimizations/VariablesInRegisters/Value', false);
|
||||||
UncertainOptimizations := aXMLConfig.GetValue(p+'Optimizations/UncertainOptimizations/Value', false);
|
UncertainOptimizations := aXMLConfig.GetValue(p+'Optimizations/UncertainOptimizations/Value', false);
|
||||||
OptimizationLevel := aXMLConfig.GetValue(p+'Optimizations/OptimizationLevel/Value', 1);
|
OptimizationLevel := aXMLConfig.GetValue(p+'Optimizations/OptimizationLevel/Value', 1);
|
||||||
TargetOS := aXMLConfig.GetValue(p+'TargetOS/Value', '');
|
|
||||||
|
|
||||||
{ Linking }
|
{ Linking }
|
||||||
p:=Path+'Linking/';
|
p:=Path+'Linking/';
|
||||||
|
@ -5,8 +5,10 @@ unit compiler_codegen_options;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes,SysUtils,FileUtil,Forms,Controls,Graphics,Dialogs,StdCtrls,ExtCtrls,
|
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
||||||
IDEOptionsIntf,Project,CompilerOptions,LazarusIDEStrConsts;
|
ExtCtrls,
|
||||||
|
DefineTemplates, IDEOptionsIntf, Project, CompilerOptions,
|
||||||
|
LazarusIDEStrConsts;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -51,6 +53,16 @@ implementation
|
|||||||
|
|
||||||
{$R *.lfm}
|
{$R *.lfm}
|
||||||
|
|
||||||
|
function CaptionToOS(const OS: string): string;
|
||||||
|
begin
|
||||||
|
Result:=LowerCase(OS);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function CaptionToCPU(const CPU: string): string;
|
||||||
|
begin
|
||||||
|
Result:=LowerCase(CPU);
|
||||||
|
end;
|
||||||
|
|
||||||
function ProcessorToCaption(const Processor: string): string;
|
function ProcessorToCaption(const Processor: string): string;
|
||||||
begin
|
begin
|
||||||
if SysUtils.CompareText(Processor, '386') = 0 then
|
if SysUtils.CompareText(Processor, '386') = 0 then
|
||||||
@ -264,12 +276,12 @@ begin
|
|||||||
NewTargetOS := TargetOSComboBox.Text;
|
NewTargetOS := TargetOSComboBox.Text;
|
||||||
if TargetOSComboBox.Items.IndexOf(NewTargetOS) <= 0 then
|
if TargetOSComboBox.Items.IndexOf(NewTargetOS) <= 0 then
|
||||||
NewTargetOS := '';
|
NewTargetOS := '';
|
||||||
TargetOS := NewTargetOS;
|
TargetOS := CaptionToOS(NewTargetOS);
|
||||||
|
|
||||||
NewTargetCPU := TargetCPUComboBox.Text;
|
NewTargetCPU := TargetCPUComboBox.Text;
|
||||||
if TargetCPUComboBox.Items.IndexOf(NewTargetCPU) <= 0 then
|
if TargetCPUComboBox.Items.IndexOf(NewTargetCPU) <= 0 then
|
||||||
NewTargetCPU := '';
|
NewTargetCPU := '';
|
||||||
TargetCPU := NewTargetCPU;
|
TargetCPU := CaptionToCPU(NewTargetCPU);
|
||||||
|
|
||||||
TargetProcessor := CaptionToProcessor(TargetProcessorProcComboBox.Text);
|
TargetProcessor := CaptionToProcessor(TargetProcessorProcComboBox.Text);
|
||||||
VariablesInRegisters := chkOptVarsInReg.Checked;
|
VariablesInRegisters := chkOptVarsInReg.Checked;
|
||||||
|
Loading…
Reference in New Issue
Block a user