* Allow to build stub

This commit is contained in:
Michaël Van Canneyt 2024-05-14 08:33:14 +02:00
parent a9c88ace25
commit 4664b14081

View File

@ -18,17 +18,19 @@ program webidl2pas;
uses
Classes, SysUtils, CustApp, webidlscanner, webidltopas, pascodegen, typinfo,
webidltopas2js, webidltowasmjob;
webidltopas2js, webidltowasmjob, webidltowasmstub;
type
TWebIDLToPasFormat = (
wifPas2js,
wifWasmJob
wifWasmJob,
wifWasmJobStub
);
const
WebIDLToPasFormatNames: array[TWebIDLToPasFormat] of string = (
'pas2js',
'wasmjob'
'wasmjob',
'wasmjobstub'
);
type
@ -261,6 +263,8 @@ begin
case OutputFormat of
wifWasmJob:
FWebIDLToPas:=TWebIDLToPasWasmJob.Create(Self);
wifWasmJobStub:
FWebIDLToPas:=TWebIDLToPasWasmJobStub.Create(Self);
else
FWebIDLToPas:=TWebIDLToPas2js.Create(Self);
end;
@ -306,6 +310,7 @@ begin
Writeln(StdErr,'-o --output=FileName output file. Defaults to unit name with .pas extension appended.');
Writeln(StdErr,'-p --optionsinheader add options to header of generated file');
Writeln(StdErr,'-s --stub Write a stub implementation for native compilation');
Writeln(StdErr,'-t --typealiases=alias A comma separated list of type aliases in Alias=Name form');
Writeln(StdErr,' use @filename to load the aliases from file.');
Writeln(StdErr,'-u --unitname=Name name for unit. Defaults to input file without extension.');