Emscripten: Provide Module.script
...which is useful for some downstream scripts Change-Id: Ibf9d336fb4ad018dcaa5ed460cac1e8e5030ab50 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184334 Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de> Tested-by: Jenkins
This commit is contained in:
parent
60f9660382
commit
fae15203e8
@ -80,6 +80,8 @@ $(call gb_Executable_get_linktarget_target,soffice_bin): \
|
||||
$(SRCDIR)/static/emscripten/uno.js \
|
||||
$(EMSCRIPTEN_EXTRA_SOFFICE_PRE_JS)
|
||||
|
||||
$(eval $(call gb_Executable_add_prejs,soffice_bin,$(SRCDIR)/static/emscripten/script.js))
|
||||
|
||||
$(eval $(call gb_Executable_add_ldflags,soffice_bin, \
|
||||
--post-js $(gb_CustomTarget_workdir)/static/unoembind/bindings_uno.js \
|
||||
--post-js $(SRCDIR)/static/emscripten/uno.js \
|
||||
|
@ -183,7 +183,8 @@ $(if $(filter Library,$(TARGETTYPE)), $(call gb_Helper_abbreviate_dirs,\
|
||||
$(if $(and $(filter CppunitTest Executable,$(TARGETTYPE)),$(filter EMSCRIPTEN,$(OS))), \
|
||||
$(if $(filter TRUE,$(ENABLE_QT5)), \
|
||||
sed -e 's/@APPNAME@/$(subst $(gb_Executable_EXT),,$(notdir $(1)))/' $(QT5_PLATFORMS_SRCDIR)/wasm_shell.html > $(dir $(1))qt_$(basename $(notdir $(1))).html && \
|
||||
cp $(QT5_PLATFORMS_SRCDIR)/qtlogo.svg $(QT5_PLATFORMS_SRCDIR)/qtloader.js $(dir $(1)) && \
|
||||
sed -e 's/var Module = {}/var Module = {script: document.currentScript}/' $(QT5_PLATFORMS_SRCDIR)/qtloader.js > $(dir $(1))qtloader.js && \
|
||||
cp $(QT5_PLATFORMS_SRCDIR)/qtlogo.svg $(dir $(1)) && \
|
||||
,$(if $(filter TRUE,$(ENABLE_QT6)), \
|
||||
sed -z -e 's/@APPNAME@/$(basename $(notdir $(1)))/g' -e 's/@APPEXPORTNAME@/$(basename $(notdir $(1)))_entry/g' -e 's/@PRELOAD@\n }/}$(COMMA)$(subst ','\'',$(EMSCRIPTEN_EXTRA_QTLOADER_CONFIG))/' -e 's/}$(CLOSE_PAREN);$$/}$(CLOSE_PAREN); window.Module = instance;/' $(QT6_PLATFORMS_SRCDIR)/wasm_shell.html > $(dir $(1))qt_$(basename $(notdir $(1))).html && \
|
||||
cp $(QT6_PLATFORMS_SRCDIR)/qtlogo.svg $(QT6_PLATFORMS_SRCDIR)/qtloader.js $(dir $(1)) && \
|
||||
|
14
static/emscripten/script.js
Normal file
14
static/emscripten/script.js
Normal file
@ -0,0 +1,14 @@
|
||||
/* -*- Mode: JS; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
if (typeof Module.script == 'undefined' && typeof document != 'undefined') {
|
||||
Module.script = document.currentScript;
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
|
Loading…
x
Reference in New Issue
Block a user