Emscripten: Only add the --pre-js code to the soffice executable
commitcf0b0f0dd04fae98b686cd5768673c217a58fab6
authorStephan Bergmann <stephan.bergmann@allotropia.de>
Tue, 30 Apr 2024 13:24:44 +0000 (30 15:24 +0200)
committerStephan Bergmann <stephan.bergmann@allotropia.de>
Tue, 30 Apr 2024 15:49:17 +0000 (30 17:49 +0200)
treeec810fe8461f513a69c658cb65c22aa89c004762
parent4cec279cf2bf55d33e0eb6c92348aa883d7593ff
Emscripten: Only add the --pre-js code to the soffice executable

...so that e.g. executing `echo test | node instdir/program/uri-encode.js`
doesn't fail with

> instdir/program/uri-encode.js:460
>       throw ex;
>       ^
>
> ReferenceError: XMLHttpRequest is not defined
>     at runMetaWithFS (instdir/program/uri-encode.js:312:15)
>     at callRuntimeCallbacks (instdir/program/uri-encode.js:1882:26)
>     at preRun (instdir/program/uri-encode.js:913:3)
>     at run (instdir/program/uri-encode.js:6854:3)
>     at runCaller (instdir/program/uri-encode.js:6802:19)
>     at removeRunDependency (instdir/program/uri-encode.js:1060:7)
>     at receiveInstance (instdir/program/uri-encode.js:1265:5)
>     at receiveInstantiationResult (instdir/program/uri-encode.js:1281:5)

(There's nothing special about uri-encode here, it just happens to be the only
other executable that is built into instdir/program/ by the Emscripten build,
even if it is probably not even useful there.  It expects to read something from
stdin, hence the echo part.)

(The generic solenv/gbuild/Executable.mk no longer depends on
soffice.data.js.link, but it still depends on soffice.data and
soffice.data.js.metadata for some cp instructions in
solenv/gbuild/platform/unxgcc.mk, so make those dependencies explicit.  That can
probably be cleaned up further in a next step.)

Change-Id: I993878a5f6d19d13728d17e803ae7d773946a1d1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166930
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Tested-by: Jenkins
desktop/Executable_soffice_bin.mk
solenv/gbuild/Executable.mk
solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk