mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 08:59:13 +02:00
IDE: compare compiled file: ignore spaces between options
git-svn-id: trunk@47861 -
This commit is contained in:
parent
df7e84d2d7
commit
b233984952
@ -647,6 +647,7 @@ function ParseString(Options: TParsedCompilerOptions;
|
|||||||
const UnparsedValue: string;
|
const UnparsedValue: string;
|
||||||
PlatformIndependent: boolean): string;
|
PlatformIndependent: boolean): string;
|
||||||
function GetMakefileMacroValue(const MacroName: string): string;
|
function GetMakefileMacroValue(const MacroName: string): string;
|
||||||
|
function TargetNeedsFPCOptionCG(TargetOS, TargetCPU: string): boolean;
|
||||||
|
|
||||||
procedure GatherInheritedOptions(AddOptionsList: TFPList;
|
procedure GatherInheritedOptions(AddOptionsList: TFPList;
|
||||||
Parsed: TCompilerOptionsParseType;
|
Parsed: TCompilerOptionsParseType;
|
||||||
@ -714,6 +715,13 @@ begin
|
|||||||
Result:='';
|
Result:='';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TargetNeedsFPCOptionCG(TargetOS, TargetCPU: string): boolean;
|
||||||
|
begin
|
||||||
|
Result:= (TargetCPU='x86_64')
|
||||||
|
and ((TargetOS='linux') or (TargetOS='freebsd') or (TargetOS='netbsd')
|
||||||
|
or (TargetOS='openbsd') or (TargetOS='solaris'));
|
||||||
|
end;
|
||||||
|
|
||||||
procedure GatherInheritedOptions(AddOptionsList: TFPList;
|
procedure GatherInheritedOptions(AddOptionsList: TFPList;
|
||||||
Parsed: TCompilerOptionsParseType;
|
Parsed: TCompilerOptionsParseType;
|
||||||
var InheritedOptionStrings: TInheritedCompOptsStrings);
|
var InheritedOptionStrings: TInheritedCompOptsStrings);
|
||||||
@ -2812,10 +2820,7 @@ begin
|
|||||||
if RelocatableUnit and (CurSrcOS='win') then
|
if RelocatableUnit and (CurSrcOS='win') then
|
||||||
switches := switches + ' -WR';
|
switches := switches + ' -WR';
|
||||||
if (not (ccloNoMacroParams in Flags))
|
if (not (ccloNoMacroParams in Flags))
|
||||||
and (CurTargetCPU='x86_64')
|
and TargetNeedsFPCOptionCG(CurTargetOS,CurTargetCPU) then
|
||||||
and ((CurTargetOS='linux') or (CurTargetOS='freebsd') or (CurTargetOS='netbsd')
|
|
||||||
or (CurTargetOS='openbsd') or (CurTargetOS='solaris'))
|
|
||||||
then
|
|
||||||
switches := switches + ' -Cg'; // see bug 17412
|
switches := switches + ' -Cg'; // see bug 17412
|
||||||
|
|
||||||
{ Checks }
|
{ Checks }
|
||||||
|
@ -533,39 +533,40 @@ var
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
Result:=TStringList.Create;
|
Result:=TStringList.Create;
|
||||||
Reduced:=CompParams;
|
Reduced:='';
|
||||||
AllPaths:=Result;
|
AllPaths:=Result;
|
||||||
EndPos:=1;
|
EndPos:=1;
|
||||||
while ReadNextFPCParameter(Reduced,EndPos,StartPos) do begin
|
while ReadNextFPCParameter(CompParams,EndPos,StartPos) do begin
|
||||||
if (Reduced[StartPos]='-') and (StartPos<length(Reduced)) then begin
|
if (CompParams[StartPos]='-') and (StartPos<length(CompParams)) then begin
|
||||||
case Reduced[StartPos+1] of
|
case CompParams[StartPos+1] of
|
||||||
'F':
|
'F':
|
||||||
// search paths
|
// search paths
|
||||||
if StartPos<length(Reduced)-1 then begin
|
if StartPos<length(CompParams)-1 then begin
|
||||||
Path:=copy(Reduced,StartPos+3,EndPos-StartPos-3);
|
Path:=copy(CompParams,StartPos+3,EndPos-StartPos-3);
|
||||||
if (Path<>'') and (Path[1] in ['''','"']) then
|
if (Path<>'') and (Path[1] in ['''','"']) then
|
||||||
Path:=AnsiDequotedStr(Path,Path[1]);
|
Path:=AnsiDequotedStr(Path,Path[1]);
|
||||||
case Reduced[StartPos+2] of
|
case Reduced[StartPos+2] of
|
||||||
'u': AddSearchPath('UnitPath');
|
'u': begin AddSearchPath('UnitPath'); continue; end;
|
||||||
'U': AllPaths.Values['UnitOutputDir']:=Path;
|
'U': begin AllPaths.Values['UnitOutputDir']:=Path; continue; end;
|
||||||
'i': AddSearchPath('IncPath');
|
'i': begin AddSearchPath('IncPath'); continue; end;
|
||||||
'o': AddSearchPath('ObjectPath');
|
'o': begin AddSearchPath('ObjectPath'); continue; end;
|
||||||
'l': AddSearchPath('LibPath');
|
'l': begin AddSearchPath('LibPath'); continue; end;
|
||||||
else continue;
|
|
||||||
end;
|
end;
|
||||||
DeleteOption;
|
|
||||||
end;
|
end;
|
||||||
'v':
|
'v':
|
||||||
// verbosity
|
// verbosity
|
||||||
DeleteOption;
|
continue;
|
||||||
'i','l':
|
'i','l':
|
||||||
// information
|
// information
|
||||||
DeleteOption;
|
continue;
|
||||||
'B':
|
'B':
|
||||||
// build clean
|
// build clean
|
||||||
DeleteOption;
|
continue;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
if Reduced<>'' then
|
||||||
|
Reduced+=' ';
|
||||||
|
Reduced+=copy(CompParams,StartPos,EndPos-StartPos);
|
||||||
end;
|
end;
|
||||||
if BaseDir<>'' then begin
|
if BaseDir<>'' then begin
|
||||||
for i:=0 to AllPaths.Count-1 do begin
|
for i:=0 to AllPaths.Count-1 do begin
|
||||||
@ -2970,8 +2971,6 @@ begin
|
|||||||
stats^.CompilerFilename:=StringReplace(stats^.CompilerFilename,'%(','$(',[rfReplaceAll]);
|
stats^.CompilerFilename:=StringReplace(stats^.CompilerFilename,'%(','$(',[rfReplaceAll]);
|
||||||
stats^.Params:=StringReplace(stats^.Params,'%(','$(',[rfReplaceAll]);
|
stats^.Params:=StringReplace(stats^.Params,'%(','$(',[rfReplaceAll]);
|
||||||
end;
|
end;
|
||||||
end;
|
|
||||||
if stats^.ViaMakefile then begin
|
|
||||||
ForcePathDelims(stats^.CompilerFilename);
|
ForcePathDelims(stats^.CompilerFilename);
|
||||||
ForcePathDelims(stats^.Params);
|
ForcePathDelims(stats^.Params);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user