mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-09 21:56:00 +02:00
IDE: use target parameters for fpc when getting all compiler options : '-T$(TargetOS) -P$(TargetCPU).
git-svn-id: trunk@42393 -
This commit is contained in:
parent
5b8874736a
commit
ae81cac0c9
@ -45,7 +45,7 @@ uses
|
|||||||
OutputFilter,
|
OutputFilter,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
UTF8Process, InfoBuild, IDEMsgIntf, CompOptsIntf, IDEExternToolIntf,
|
UTF8Process, InfoBuild, IDEMsgIntf, CompOptsIntf, IDEExternToolIntf,
|
||||||
DefineTemplates, LazFileUtils;
|
DefineTemplates, TransferMacros, LazFileUtils;
|
||||||
|
|
||||||
type
|
type
|
||||||
TOnCmdLineCreate = procedure(var CmdLine: string; var Abort:boolean) of object;
|
TOnCmdLineCreate = procedure(var CmdLine: string; var Abort:boolean) of object;
|
||||||
@ -997,13 +997,17 @@ function TCompilerOptReader.ReadAndParseOptions: TModalResult;
|
|||||||
// fpc -Fr$(FPCMsgFile) -i
|
// fpc -Fr$(FPCMsgFile) -i
|
||||||
var
|
var
|
||||||
Lines: TStringList;
|
Lines: TStringList;
|
||||||
|
ParsedTarget: String;
|
||||||
begin
|
begin
|
||||||
OptionIdCounter := 0;
|
OptionIdCounter := 0;
|
||||||
if fCompilerExecutable = '' then
|
if fCompilerExecutable = '' then
|
||||||
fCompilerExecutable := 'fpc'; // Let's hope "fpc" is found in PATH.
|
fCompilerExecutable := 'fpc'; // Let's hope "fpc" is found in PATH.
|
||||||
|
ParsedTarget := '-T$(TargetOS) -P$(TargetCPU)';
|
||||||
|
if not GlobalMacroList.SubstituteStr(ParsedTarget) then
|
||||||
|
raise Exception.CreateFmt('ReadAndParseOptions: Cannot substitute macros "%s".',
|
||||||
|
[ParsedTarget]);
|
||||||
// FPC with option -i
|
// FPC with option -i
|
||||||
Lines:=RunTool(fCompilerExecutable, '-i');
|
Lines:=RunTool(fCompilerExecutable, ParsedTarget + ' -i');
|
||||||
try
|
try
|
||||||
if Lines = Nil then Exit(mrCancel);
|
if Lines = Nil then Exit(mrCancel);
|
||||||
Result := ParseI(Lines);
|
Result := ParseI(Lines);
|
||||||
@ -1011,9 +1015,8 @@ begin
|
|||||||
finally
|
finally
|
||||||
Lines.Free;
|
Lines.Free;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// FPC with option -h
|
// FPC with option -h
|
||||||
Lines:=RunTool(fCompilerExecutable, '-h');
|
Lines:=RunTool(fCompilerExecutable, ParsedTarget + ' -h');
|
||||||
try
|
try
|
||||||
if Lines = Nil then Exit(mrCancel);
|
if Lines = Nil then Exit(mrCancel);
|
||||||
Result := ParseH(Lines);
|
Result := ParseH(Lines);
|
||||||
|
Loading…
Reference in New Issue
Block a user