summaryrefslogtreecommitdiff
path: root/solenv/gbuild
diff options
context:
space:
mode:
authorStephan Bergmann <stephan.bergmann@allotropia.de>2024-04-30 15:24:44 +0200
committerStephan Bergmann <stephan.bergmann@allotropia.de>2024-04-30 17:49:17 +0200
commitcf0b0f0dd04fae98b686cd5768673c217a58fab6 (patch)
treeec810fe8461f513a69c658cb65c22aa89c004762 /solenv/gbuild
parent4cec279cf2bf55d33e0eb6c92348aa883d7593ff (diff)
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
Diffstat (limited to 'solenv/gbuild')
-rw-r--r--solenv/gbuild/Executable.mk4
-rw-r--r--solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk9
2 files changed, 3 insertions, 10 deletions
diff --git a/solenv/gbuild/Executable.mk b/solenv/gbuild/Executable.mk
index 7c8cf199496d..3027b0de30fa 100644
--- a/solenv/gbuild/Executable.mk
+++ b/solenv/gbuild/Executable.mk
@@ -76,7 +76,9 @@ $(call gb_Executable_get_clean_target,$(1)) : $(call gb_LinkTarget_get_clean_tar
$(call gb_Executable_get_clean_target,$(1)) : AUXTARGETS :=
$(call gb_Executable_Executable_platform,$(1),$(2),$(gb_Executable_BINDIR)/$(1).lib)
ifeq ($(OS),EMSCRIPTEN)
-$(call gb_LinkTarget_get_target,$(call gb_Executable_get_linktarget,$(1))) : $(call gb_CustomTarget_get_workdir,static/emscripten_fs_image)/soffice.data.js.link
+$(call gb_LinkTarget_get_target,$(call gb_Executable_get_linktarget,$(1))) : \
+ $(call gb_CustomTarget_get_workdir,static/emscripten_fs_image)/soffice.data \
+ $(call gb_CustomTarget_get_workdir,static/emscripten_fs_image)/soffice.data.js.metadata
endif
$$(eval $$(call gb_Module_register_target,$(call gb_Executable_get_target,$(1)),$(call gb_Executable_get_clean_target,$(1))))
diff --git a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
index 64713ec66fd1..e660c20cc650 100644
--- a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
@@ -9,11 +9,6 @@
include $(GBUILDDIR)/platform/unxgcc.mk
-# don't sort; later can override previous settings!
-gb_EMSCRIPTEN_PRE_JS_FILES = \
- $(SRCDIR)/static/emscripten/environment.js \
- $(call gb_CustomTarget_get_workdir,static/emscripten_fs_image)/soffice.data.js.link \
-
gb_RUN_CONFIGURE := $(SRCDIR)/solenv/bin/run-configure
# avoid -s SAFE_HEAP=1 - c.f. gh#8584 this breaks source maps
gb_EMSCRIPTEN_CPPFLAGS := -pthread -s USE_PTHREADS=1 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE
@@ -85,8 +80,6 @@ $(call gb_LinkTarget_add_auxtargets,$(2),\
$(patsubst %.lib,%.worker.js,$(3)) \
)
-$(foreach pre_js,$(gb_EMSCRIPTEN_PRE_JS_FILES),$(call gb_Executable_add_prejs,$(1),$(pre_js)))
-
endef
define gb_CppunitTest_CppunitTest_platform
@@ -97,8 +90,6 @@ $(call gb_LinkTarget_add_auxtargets,$(2),\
$(patsubst %.lib,%.worker.js,$(3)) \
)
-$(foreach pre_js,$(gb_EMSCRIPTEN_PRE_JS_FILES),$(call gb_CppunitTest_add_prejs,$(1),$(pre_js)))
-
endef
gb_SUPPRESS_TESTS := $(true)