mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-07 08:39:01 +01:00
codetools: added IsPas2jsTargetOS IsPas2jsTargetCPU, removed deprecated functions
git-svn-id: trunk@60590 -
This commit is contained in:
parent
8fe77a05b7
commit
9f27095fee
@ -853,8 +853,6 @@ type
|
|||||||
property ChangeStamp: integer read FChangeStamp;
|
property ChangeStamp: integer read FChangeStamp;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TFPCTargetConfigCache = TPCTargetConfigCache deprecated 'use TPCTargetConfigCache'; // Laz 1.9
|
|
||||||
|
|
||||||
{ TPCTargetConfigCaches
|
{ TPCTargetConfigCaches
|
||||||
List of TPCTargetConfigCache }
|
List of TPCTargetConfigCache }
|
||||||
|
|
||||||
@ -885,8 +883,6 @@ type
|
|||||||
property ExtraOptions: string read FExtraOptions write FExtraOptions; // additional compiler options not used as key, e.g. -Fr<language file>
|
property ExtraOptions: string read FExtraOptions write FExtraOptions; // additional compiler options not used as key, e.g. -Fr<language file>
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TFPCTargetConfigCaches = TPCTargetConfigCaches deprecated 'use TPCTargetConfigCaches'; // Laz 1.9
|
|
||||||
|
|
||||||
TFPCSourceCaches = class;
|
TFPCSourceCaches = class;
|
||||||
|
|
||||||
{ TFPCSourceCache
|
{ TFPCSourceCache
|
||||||
@ -1069,6 +1065,8 @@ function GetDefaultCompilerFilename(const TargetCPU: string = ''; Cross: boolean
|
|||||||
procedure GetTargetProcessors(const TargetCPU: string; aList: TStrings);
|
procedure GetTargetProcessors(const TargetCPU: string; aList: TStrings);
|
||||||
function GetFPCTargetOS(TargetOS: string): string; // normalize
|
function GetFPCTargetOS(TargetOS: string): string; // normalize
|
||||||
function GetFPCTargetCPU(TargetCPU: string): string; // normalize
|
function GetFPCTargetCPU(TargetCPU: string): string; // normalize
|
||||||
|
function IsPas2jsTargetOS(TargetOS: string): boolean;
|
||||||
|
function IsPas2jsTargetCPU(TargetCPU: string): boolean;
|
||||||
|
|
||||||
function IsCTExecutable(AFilename: string; out ErrorMsg: string): boolean; // not thread-safe
|
function IsCTExecutable(AFilename: string; out ErrorMsg: string): boolean; // not thread-safe
|
||||||
|
|
||||||
@ -3852,6 +3850,18 @@ begin
|
|||||||
Result:=LowerCase(TargetCPU);
|
Result:=LowerCase(TargetCPU);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function IsPas2jsTargetOS(TargetOS: string): boolean;
|
||||||
|
begin
|
||||||
|
TargetOS:=LowerCase(TargetOS);
|
||||||
|
Result:=(TargetOS='browser') or (TargetOS='nodejs');
|
||||||
|
end;
|
||||||
|
|
||||||
|
function IsPas2jsTargetCPU(TargetCPU: string): boolean;
|
||||||
|
begin
|
||||||
|
TargetCPU:=LowerCase(TargetCPU);
|
||||||
|
Result:=Pos('ecmascript',TargetCPU)>0;
|
||||||
|
end;
|
||||||
|
|
||||||
function IsCTExecutable(AFilename: string; out ErrorMsg: string): boolean;
|
function IsCTExecutable(AFilename: string; out ErrorMsg: string): boolean;
|
||||||
begin
|
begin
|
||||||
Result:=false;
|
Result:=false;
|
||||||
@ -8819,10 +8829,11 @@ begin
|
|||||||
CompilerDate:=-1;
|
CompilerDate:=-1;
|
||||||
if FileExistsCached(Compiler) then begin
|
if FileExistsCached(Compiler) then begin
|
||||||
CompilerDate:=FileAgeCached(Compiler);
|
CompilerDate:=FileAgeCached(Compiler);
|
||||||
ExtraOptions:=GetFPCInfoCmdLineOptions(ExtraOptions);// contains TargetOS and TargetCPU
|
ExtraOptions:=GetFPCInfoCmdLineOptions(ExtraOptions);// add -TTargetOS and -PTargetCPU
|
||||||
BaseDir:='';
|
BaseDir:='';
|
||||||
|
|
||||||
// get version, OS and CPU
|
// check if this is a FPC compatible compiler and get version, OS and CPU
|
||||||
|
// Note: fpc.exe calls the real compiler depending on -T and -P
|
||||||
InfoTypes:=[fpciTargetOS,fpciTargetProcessor,fpciFullVersion];
|
InfoTypes:=[fpciTargetOS,fpciTargetProcessor,fpciFullVersion];
|
||||||
Info:=RunFPCInfo(Compiler,InfoTypes,ExtraOptions);
|
Info:=RunFPCInfo(Compiler,InfoTypes,ExtraOptions);
|
||||||
if ParseFPCInfo(Info,InfoTypes,Infos) then begin
|
if ParseFPCInfo(Info,InfoTypes,Infos) then begin
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user