mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 12:29:29 +02:00
IDE: merged simplified SHortenPath, IDEIntf: added TLazCompilerOptions.CreateTargetFilename
git-svn-id: branches/fixes_2_0@60859 -
This commit is contained in:
parent
96a144af00
commit
f6a049365e
@ -330,6 +330,7 @@ type
|
|||||||
function IsActive: boolean; virtual;
|
function IsActive: boolean; virtual;
|
||||||
function TrimCustomOptions(o: string): string; virtual; abstract;
|
function TrimCustomOptions(o: string): string; virtual; abstract;
|
||||||
function CreatePPUFilename(const SourceFileName: string): string; virtual; abstract;
|
function CreatePPUFilename(const SourceFileName: string): string; virtual; abstract;
|
||||||
|
function CreateTargetFilename: string; virtual; abstract;
|
||||||
function GetUnitOutputDirectory(RelativeToBaseDir: boolean): string; virtual; abstract;
|
function GetUnitOutputDirectory(RelativeToBaseDir: boolean): string; virtual; abstract;
|
||||||
public
|
public
|
||||||
property Owner: TObject read fOwner write fOwner;
|
property Owner: TObject read fOwner write fOwner;
|
||||||
|
@ -476,7 +476,7 @@ type
|
|||||||
function MakeOptionsString(Flags: TCompilerCmdLineOptions): String; virtual;
|
function MakeOptionsString(Flags: TCompilerCmdLineOptions): String; virtual;
|
||||||
function GetSyntaxOptionsString(Kind: TPascalCompiler): string; virtual;
|
function GetSyntaxOptionsString(Kind: TPascalCompiler): string; virtual;
|
||||||
function CreatePPUFilename(const SourceFileName: string): string; override;
|
function CreatePPUFilename(const SourceFileName: string): string; override;
|
||||||
function CreateTargetFilename: string; virtual;
|
function CreateTargetFilename: string; override;
|
||||||
function GetTargetFileExt: string; virtual;
|
function GetTargetFileExt: string; virtual;
|
||||||
function GetTargetFilePrefix: string; virtual;
|
function GetTargetFilePrefix: string; virtual;
|
||||||
procedure GetInheritedCompilerOptions(var OptionsList: TFPList // list of TAdditionalCompilerOptions
|
procedure GetInheritedCompilerOptions(var OptionsList: TFPList // list of TAdditionalCompilerOptions
|
||||||
@ -532,8 +532,7 @@ type
|
|||||||
function GetUnparsedPath(Option: TParsedCompilerOptString;
|
function GetUnparsedPath(Option: TParsedCompilerOptString;
|
||||||
InheritedOption: TInheritedCompilerOption;
|
InheritedOption: TInheritedCompilerOption;
|
||||||
RelativeToBaseDir: boolean): string;
|
RelativeToBaseDir: boolean): string;
|
||||||
function ShortenPath(const SearchPath: string;
|
function ShortenPath(const SearchPath: string): string;
|
||||||
MakeAlwaysRelative: boolean): string;
|
|
||||||
function GetCustomOptions(Parsed: TCompilerOptionsParseType): string;
|
function GetCustomOptions(Parsed: TCompilerOptionsParseType): string;
|
||||||
function TrimCustomOptions(o: string): string; override;
|
function TrimCustomOptions(o: string): string; override;
|
||||||
function GetOptionsForCTDefines: string;
|
function GetOptionsForCTDefines: string;
|
||||||
@ -1156,7 +1155,7 @@ procedure TBaseCompilerOptions.SetIncludePaths(const AValue: String);
|
|||||||
var
|
var
|
||||||
NewValue: String;
|
NewValue: String;
|
||||||
begin
|
begin
|
||||||
NewValue:=ShortenPath(AValue,false);
|
NewValue:=ShortenPath(AValue);
|
||||||
if IncludePath=NewValue then exit;
|
if IncludePath=NewValue then exit;
|
||||||
ParsedOpts.SetUnparsedValue(pcosIncludePath,NewValue);
|
ParsedOpts.SetUnparsedValue(pcosIncludePath,NewValue);
|
||||||
{$IFDEF VerboseIDEModified}
|
{$IFDEF VerboseIDEModified}
|
||||||
@ -1204,7 +1203,7 @@ procedure TBaseCompilerOptions.SetSrcPath(const AValue: string);
|
|||||||
var
|
var
|
||||||
NewValue: String;
|
NewValue: String;
|
||||||
begin
|
begin
|
||||||
NewValue:=ShortenPath(AValue,false);
|
NewValue:=ShortenPath(AValue);
|
||||||
if SrcPath=NewValue then exit;
|
if SrcPath=NewValue then exit;
|
||||||
ParsedOpts.SetUnparsedValue(pcosSrcPath,NewValue);
|
ParsedOpts.SetUnparsedValue(pcosSrcPath,NewValue);
|
||||||
{$IFDEF VerboseIDEModified}
|
{$IFDEF VerboseIDEModified}
|
||||||
@ -1217,7 +1216,7 @@ procedure TBaseCompilerOptions.SetDebugPath(const AValue: string);
|
|||||||
var
|
var
|
||||||
NewValue: String;
|
NewValue: String;
|
||||||
begin
|
begin
|
||||||
NewValue:=ShortenPath(AValue,false);
|
NewValue:=ShortenPath(AValue);
|
||||||
if DebugPath=NewValue then exit;
|
if DebugPath=NewValue then exit;
|
||||||
ParsedOpts.SetUnparsedValue(pcosDebugPath,NewValue);
|
ParsedOpts.SetUnparsedValue(pcosDebugPath,NewValue);
|
||||||
{$IFDEF VerboseIDEModified}
|
{$IFDEF VerboseIDEModified}
|
||||||
@ -1396,7 +1395,7 @@ procedure TBaseCompilerOptions.SetLibraryPaths(const AValue: String);
|
|||||||
var
|
var
|
||||||
NewValue: String;
|
NewValue: String;
|
||||||
begin
|
begin
|
||||||
NewValue:=ShortenPath(AValue,false);
|
NewValue:=ShortenPath(AValue);
|
||||||
if Libraries=NewValue then exit;
|
if Libraries=NewValue then exit;
|
||||||
ParsedOpts.SetUnparsedValue(pcosLibraryPath,NewValue);
|
ParsedOpts.SetUnparsedValue(pcosLibraryPath,NewValue);
|
||||||
{$IFDEF VerboseIDEModified}
|
{$IFDEF VerboseIDEModified}
|
||||||
@ -1430,7 +1429,7 @@ procedure TBaseCompilerOptions.SetUnitPaths(const AValue: String);
|
|||||||
var
|
var
|
||||||
NewValue: String;
|
NewValue: String;
|
||||||
begin
|
begin
|
||||||
NewValue:=ShortenPath(AValue,false);
|
NewValue:=ShortenPath(AValue);
|
||||||
if OtherUnitFiles=NewValue then exit;
|
if OtherUnitFiles=NewValue then exit;
|
||||||
ParsedOpts.SetUnparsedValue(pcosUnitPath,NewValue);
|
ParsedOpts.SetUnparsedValue(pcosUnitPath,NewValue);
|
||||||
{$IFDEF VerboseIDEModified}
|
{$IFDEF VerboseIDEModified}
|
||||||
@ -1453,7 +1452,7 @@ procedure TBaseCompilerOptions.SetObjectPath(const AValue: string);
|
|||||||
var
|
var
|
||||||
NewValue: String;
|
NewValue: String;
|
||||||
begin
|
begin
|
||||||
NewValue:=ShortenPath(AValue,false);
|
NewValue:=ShortenPath(AValue);
|
||||||
if ObjectPath=NewValue then exit;
|
if ObjectPath=NewValue then exit;
|
||||||
ParsedOpts.SetUnparsedValue(pcosObjectPath,NewValue);
|
ParsedOpts.SetUnparsedValue(pcosObjectPath,NewValue);
|
||||||
{$IFDEF VerboseIDEModified}
|
{$IFDEF VerboseIDEModified}
|
||||||
@ -1562,7 +1561,7 @@ begin
|
|||||||
SrcPath := sp(aXMLConfig.GetValue(p+'SrcPath/Value', ''));
|
SrcPath := sp(aXMLConfig.GetValue(p+'SrcPath/Value', ''));
|
||||||
|
|
||||||
{ Conditionals }
|
{ Conditionals }
|
||||||
FConditionals:=ConvertLineEndings(UTF8Trim(
|
FConditionals:=LineBreaksToSystemLineBreaks(UTF8Trim(
|
||||||
aXMLConfig.GetValue(Path+'Conditionals/Value',DefaultConditionals),[]));
|
aXMLConfig.GetValue(Path+'Conditionals/Value',DefaultConditionals),[]));
|
||||||
TIDEBuildMacros(fBuildMacros).LoadFromXMLConfig(aXMLConfig,
|
TIDEBuildMacros(fBuildMacros).LoadFromXMLConfig(aXMLConfig,
|
||||||
Path+'BuildMacros/',PathDelimChange);
|
Path+'BuildMacros/',PathDelimChange);
|
||||||
@ -2537,14 +2536,9 @@ begin
|
|||||||
SetUnitPaths(RemoveSearchPaths(GetUnitPaths,RemSearchPath));
|
SetUnitPaths(RemoveSearchPaths(GetUnitPaths,RemSearchPath));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TBaseCompilerOptions.ShortenPath(const SearchPath: string;
|
function TBaseCompilerOptions.ShortenPath(const SearchPath: string): string;
|
||||||
MakeAlwaysRelative: boolean): string;
|
|
||||||
begin
|
begin
|
||||||
Result:=TrimSearchPath(SearchPath,'');
|
Result:=ShortenSearchPath(TrimSearchPath(SearchPath,''),BaseDirectory,BaseDirectory);
|
||||||
if MakeAlwaysRelative then
|
|
||||||
Result:=CreateRelativeSearchPath(Result,BaseDirectory)
|
|
||||||
else
|
|
||||||
Result:=ShortenSearchPath(Result,BaseDirectory,BaseDirectory);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -4487,10 +4481,10 @@ procedure TIDEBuildMacro.LoadFromXMLConfig(AXMLConfig: TXMLConfig;
|
|||||||
begin
|
begin
|
||||||
FIdentifier:=AXMLConfig.GetValue(Path+'Identifier/Value','');
|
FIdentifier:=AXMLConfig.GetValue(Path+'Identifier/Value','');
|
||||||
if not IsValidIdent(FIdentifier) then FIdentifier:='';
|
if not IsValidIdent(FIdentifier) then FIdentifier:='';
|
||||||
FDescription:=ConvertLineEndings(AXMLConfig.GetValue(Path+'Description/Value',''));
|
FDescription:=LineBreaksToSystemLineBreaks(AXMLConfig.GetValue(Path+'Description/Value',''));
|
||||||
LoadStringList(AXMLConfig,FValues,Path+'Values/');
|
LoadStringList(AXMLConfig,FValues,Path+'Values/');
|
||||||
LoadStringList(AXMLConfig,FValueDescriptions,Path+'ValueDescriptions/');
|
LoadStringList(AXMLConfig,FValueDescriptions,Path+'ValueDescriptions/');
|
||||||
FDefaultValue:=ConvertLineEndings(AXMLConfig.GetValue(Path+'Default/Value',''));
|
FDefaultValue:=LineBreaksToSystemLineBreaks(AXMLConfig.GetValue(Path+'Default/Value',''));
|
||||||
|
|
||||||
while ValueDescriptions.Count>Values.Count do
|
while ValueDescriptions.Count>Values.Count do
|
||||||
ValueDescriptions.Delete(ValueDescriptions.Count-1);
|
ValueDescriptions.Delete(ValueDescriptions.Count-1);
|
||||||
|
@ -443,7 +443,7 @@ function TCompilerPathOptionsFrame.PathEditBtnExecuted(Context: String; var NewP
|
|||||||
var
|
var
|
||||||
ExpandedPath: string;
|
ExpandedPath: string;
|
||||||
begin
|
begin
|
||||||
NewPath := FCompilerOpts.ShortenPath(NewPath, False);
|
NewPath := FCompilerOpts.ShortenPath(NewPath);
|
||||||
ExpandedPath := TrimSearchPath(NewPath, FCompilerOpts.BaseDirectory, true);
|
ExpandedPath := TrimSearchPath(NewPath, FCompilerOpts.BaseDirectory, true);
|
||||||
Result := CheckSearchPath(Context, ExpandedPath, ccomlHints);
|
Result := CheckSearchPath(Context, ExpandedPath, ccomlHints);
|
||||||
end;
|
end;
|
||||||
@ -472,7 +472,7 @@ begin
|
|||||||
if OpenDialog.Execute then
|
if OpenDialog.Execute then
|
||||||
begin
|
begin
|
||||||
NewFilename := TrimFilename(OpenDialog.Filename);
|
NewFilename := TrimFilename(OpenDialog.Filename);
|
||||||
NewFilename := FCompilerOpts.ShortenPath(NewFilename, False);
|
NewFilename := FCompilerOpts.ShortenPath(NewFilename);
|
||||||
if Sender = btnUnitOutputDir then
|
if Sender = btnUnitOutputDir then
|
||||||
UnitOutputDirEdit.Text := OpenDialog.Filename;
|
UnitOutputDirEdit.Text := OpenDialog.Filename;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user