From 4664b1408181ade714bb2bf11249dceb832fa994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Van=20Canneyt?= Date: Tue, 14 May 2024 08:33:14 +0200 Subject: [PATCH] * Allow to build stub --- utils/pas2js/webidl2pas.pp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/utils/pas2js/webidl2pas.pp b/utils/pas2js/webidl2pas.pp index 365c381a24..3481d52a3b 100644 --- a/utils/pas2js/webidl2pas.pp +++ b/utils/pas2js/webidl2pas.pp @@ -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.');