mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 19:29:24 +02:00
+ initial compiler support for WebAssembly resources. Requires WebAssembly
support in the fpcres utility, which is not implemented, yet.
This commit is contained in:
parent
14f2d8ab08
commit
440a635bce
@ -1503,7 +1503,7 @@ implementation
|
||||
var
|
||||
tcb: ttai_typedconstbuilder;
|
||||
begin
|
||||
if (target_res.id in [res_elf,res_macho,res_xcoff]) or
|
||||
if (target_res.id in [res_elf,res_macho,res_xcoff,res_wasm]) or
|
||||
{ generate the FPC_RESLOCATION symbol even when using external resources,
|
||||
because in SysInit we can only reference it unconditionally }
|
||||
((target_res.id=res_ext) and (target_info.system in systems_darwin)) then
|
||||
|
@ -54,6 +54,18 @@ uses
|
||||
resflags : [];
|
||||
);
|
||||
|
||||
res_wasm_info : tresinfo =
|
||||
(
|
||||
id : res_wasm;
|
||||
resbin : 'fpcres';
|
||||
rescmd : '-o $OBJ -a $ARCH -of wasm $DBG';
|
||||
{ cross compiled windres can be used to compile .rc files on other platforms }
|
||||
rcbin : 'windres';
|
||||
rccmd : '--include $INC -O res -D FPC -o $RES $RC';
|
||||
resourcefileclass : nil;
|
||||
resflags : [];
|
||||
);
|
||||
|
||||
res_ext_info : tresinfo =
|
||||
(
|
||||
id : res_ext;
|
||||
|
@ -353,7 +353,7 @@
|
||||
,res_m68k_palmos,res_m68k_mpw
|
||||
,res_powerpc_mpw,res_elf,res_xcoff
|
||||
,res_win64_gorc, res_macho, res_ext
|
||||
,res_jvm_raw
|
||||
,res_jvm_raw,res_wasm
|
||||
);
|
||||
|
||||
tresinfoflags = (res_external_file,res_arch_in_file_name
|
||||
|
@ -29,17 +29,6 @@ unit i_wasi;
|
||||
systems,rescmn;
|
||||
|
||||
const
|
||||
res_wasmraw_info : tresinfo =
|
||||
(
|
||||
id : res_none; // todo: not implemented. but could be as memory
|
||||
resbin : 'fpcwasmres';
|
||||
rescmd : '-o $OBJ $DBG';
|
||||
rcbin : '';
|
||||
rccmd : '';
|
||||
resourcefileclass : nil;
|
||||
resflags : [res_no_compile];
|
||||
);
|
||||
|
||||
system_wasm32_wasi_info : tsysteminfo =
|
||||
(
|
||||
system : system_wasm32_wasi;
|
||||
@ -82,7 +71,7 @@ unit i_wasi;
|
||||
link : ld_int_wasi;
|
||||
linkextern : ld_wasi;
|
||||
ar : ar_none;
|
||||
res : res_none;
|
||||
res : res_wasm;
|
||||
dbg : dbg_dwarf2;
|
||||
script : script_unix;
|
||||
endian : endian_little;
|
||||
|
@ -90,7 +90,8 @@ implementation
|
||||
|
||||
uses
|
||||
SysUtils,
|
||||
verbose;
|
||||
verbose,
|
||||
comprsrc,rescmn;
|
||||
|
||||
{ timportlibwasi }
|
||||
|
||||
@ -332,5 +333,5 @@ initialization
|
||||
RegisterExport(system_wasm32_wasi, texportlibwasi);
|
||||
RegisterLinker(ld_int_wasi,TInternalLinkerWasi);
|
||||
RegisterLinker(ld_wasi, tlinkerwasi);
|
||||
|
||||
RegisterRes(res_wasm_info,TWinLikeResourceFile);
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user