pastojs: added experimental target os electron

git-svn-id: trunk@47445 -
This commit is contained in:
Mattias Gaertner 2020-11-18 15:56:13 +00:00
parent f5acaf10ee
commit bd3093e176
3 changed files with 9 additions and 3 deletions

View File

@ -1053,13 +1053,15 @@ type
type
TPasToJsPlatform = (
PlatformBrowser,
PlatformNodeJS
PlatformNodeJS,
PlatformElectron
);
TPasToJsPlatforms = set of TPasToJsPlatform;
const
PasToJsPlatformNames: array[TPasToJsPlatform] of string = (
'Browser',
'NodeJS'
'NodeJS',
'Electron'
);
type
TPasToJsProcessor = (

View File

@ -4762,6 +4762,7 @@ begin
w(' -T<x> : Set target platform');
w(' -Tbrowser: default');
w(' -Tnodejs : add pas.run(), includes -Jc');
w(' -Telectron: experimental');
w(' -u<x> : Undefines the symbol <x>');
w(' -v<x> : Be verbose. <x> is a combination of the following letters:');
w(' e : Show errors (default)');
@ -4941,6 +4942,7 @@ begin
Log.LogPlain('Supported targets (targets marked with ''{*}'' are under development):');
Log.LogPlain([' ',PasToJsPlatformNames[PlatformBrowser],': webbrowser']);
Log.LogPlain([' ',PasToJsPlatformNames[PlatformNodeJS],': Node.js']);
Log.LogPlain([' ',PasToJsPlatformNames[PlatformElectron],': Electron app']);
Log.LogLn;
Log.LogPlain('Supported CPU instruction sets:');
Log.LogPlain(' ECMAScript5, ECMAScript6');

View File

@ -262,7 +262,8 @@ const
PCUDefaultTargetPlatform = PlatformBrowser;
PCUTargetPlatformNames: array[TPasToJsPlatform] of string = (
'Browser',
'NodeJS'
'NodeJS',
'Electron'
);
PCUDefaultTargetProcessor = ProcessorECMAScript5;
@ -3970,6 +3971,7 @@ var
Templ: TPasGenericTemplateType;
TemplObj: TJSONObject;
begin
if Parent=nil then ;
if (GenericTemplateTypes=nil) or (GenericTemplateTypes.Count=0) then exit;
Arr:=TJSONArray.Create;
Obj.Add('GenericTemplateTypes',Arr);