Emscripten: For executables, only build .js files, not .html files

...as for the by-default --enable-qt5 case we generate an additional
qt_soffice.html anyway (and for a --disable-gui --disable-qt5 build, client code
probably wants to embed the results into its own HTML document and wouldn't rely
on an soffice.html); this simplifies the build infrastructure a little

Change-Id: Ib50799b5dd2fcfeb680f257f46ff65775dcddd71
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174725
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
This commit is contained in:
Stephan Bergmann 2024-10-09 16:18:35 +02:00
parent ae44d2affa
commit ce8ac330eb
4 changed files with 4 additions and 11 deletions

View file

@ -35,12 +35,8 @@ ifeq ($(OS),MACOSX)
gb_Executable_FILENAMES := $(patsubst soffice_bin:soffice_bin,soffice_bin:soffice,$(gb_Executable_FILENAMES))
else
ifeq ($(OS),EMSCRIPTEN)
ifeq ($(ENABLE_QT6),TRUE)
gb_Executable_FILENAMES := $(patsubst soffice_bin:soffice_bin%,soffice_bin:soffice.js,$(gb_Executable_FILENAMES))
else
gb_Executable_FILENAMES := $(patsubst soffice_bin:soffice_bin%,soffice_bin:soffice.html,$(gb_Executable_FILENAMES))
endif
else
gb_Executable_FILENAMES := $(patsubst soffice_bin:soffice_bin%,soffice_bin:soffice.bin,$(gb_Executable_FILENAMES))
endif
endif

View file

@ -20,8 +20,7 @@ emscripten_install_files := \
soffice.wasm \
soffice.worker.js \
$(if $(ENABLE_SYMBOLS_FOR),soffice.wasm.dwp) \
$(if $(DISABLE_GUI), \
soffice.html, \
$(if $(DISABLE_GUI),, \
qt_soffice.html \
qtloader.js \
qtlogo.svg) \

View file

@ -30,7 +30,7 @@ ifeq ($(ENABLE_EMSCRIPTEN_PROXY_POSIX_SOCKETS),TRUE)
gb_EMSCRIPTEN_LDFLAGS += -sPROXY_POSIX_SOCKETS -lwebsocket.js
endif
gb_Executable_EXT := .html
gb_Executable_EXT := .js
gb_EMSCRIPTEN_EXCEPT = -fwasm-exceptions -s SUPPORT_LONGJMP=wasm
gb_CXXFLAGS += $(gb_EMSCRIPTEN_CPPFLAGS)
@ -77,7 +77,6 @@ define gb_Executable_Executable_platform
$(call gb_LinkTarget_add_auxtargets,$(2),\
$(patsubst %.lib,%.linkdeps,$(3)) \
$(patsubst %.lib,%.wasm,$(3)) \
$(patsubst %.lib,%.js,$(3)) \
$(patsubst %.lib,%.worker.js,$(3)) \
$(patsubst %.lib,%.wasm.dwp,$(3)) \
)
@ -88,7 +87,6 @@ define gb_CppunitTest_CppunitTest_platform
$(call gb_LinkTarget_add_auxtargets,$(2),\
$(patsubst %.lib,%.linkdeps,$(3)) \
$(patsubst %.lib,%.wasm,$(3)) \
$(patsubst %.lib,%.js,$(3)) \
$(patsubst %.lib,%.worker.js,$(3)) \
$(patsubst %.lib,%.wasm.dwp,$(3)) \
)

View file

@ -171,7 +171,7 @@ $(call gb_Helper_abbreviate_dirs,\
) \
-o $(1) \
$(if $(SOVERSIONSCRIPT),&& ln -sf ../../program/$(notdir $(1)) $(ILIBTARGET)) \
$(if $(filter EMSCRIPTEN,$(OS)),$(if $(filter TRUE,$(HAVE_EXTERNAL_DWARF)),&& emdwp -e $(patsubst %.html,%.wasm,$(1)) -o $(patsubst %.html,%.wasm.dwp,$(1)))) \
$(if $(filter EMSCRIPTEN,$(OS)),$(if $(filter TRUE,$(HAVE_EXTERNAL_DWARF)),&& emdwp -e $(patsubst %$(gb_Executable_EXT),%.wasm,$(1)) -o $(patsubst %$(gb_Executable_EXT),%.wasm.dwp,$(1)))) \
$(if $(call gb_LinkTarget__WantLock,$(2)),; RC=$$? ; rm -f $(gb_LinkTarget__Lock); if test $$RC -ne 0; then exit $$RC; fi))
$(if $(filter Library,$(TARGETTYPE)), $(call gb_Helper_abbreviate_dirs,\
@ -182,7 +182,7 @@ $(if $(filter Library,$(TARGETTYPE)), $(call gb_Helper_abbreviate_dirs,\
$(WORKDIR)/LinkTarget/$(2).exports,$(1))))
$(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_$(notdir $(1)) && \
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)) && \
,$(if $(filter TRUE,$(ENABLE_QT6)), \
sed -e 's/@APPNAME@/$(basename $(notdir $(1)))/g' -e 's/@APPEXPORTNAME@/$(basename $(notdir $(1)))_entry/g' -e 's/@PRELOAD@//g' -e 's/}$(CLOSE_PAREN);$$/}$(CLOSE_PAREN); window.Module = instance;/' $(QT6_PLATFORMS_SRCDIR)/wasm_shell.html > $(dir $(1))qt_$(basename $(notdir $(1))).html && \