Add experimental support for Emscripten JSPI
...which I've seen fundamentally working when building with recent emsdk against recent Qt6 trunk (and including <https://github.com/qt/qtbase/pull/108> "Update the check for WebAssembly JSPI support") and running on recent Chrome (with JSPI enabled under <chrome://flags/>) Change-Id: I98c11c5ee7e95b135ddc33c95c95752055ecd4c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176031 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
This commit is contained in:
parent
060d2fe39f
commit
f510ce620f
@ -176,6 +176,7 @@ export ENABLE_DEBUG=@ENABLE_DEBUG@
|
|||||||
ENABLE_DOTNET=@ENABLE_DOTNET@
|
ENABLE_DOTNET=@ENABLE_DOTNET@
|
||||||
SYSTEM_DRAGONBOX=@SYSTEM_DRAGONBOX@
|
SYSTEM_DRAGONBOX=@SYSTEM_DRAGONBOX@
|
||||||
SYSTEM_FROZEN=@SYSTEM_FROZEN@
|
SYSTEM_FROZEN=@SYSTEM_FROZEN@
|
||||||
|
export ENABLE_EMSCRIPTEN_JSPI=@ENABLE_EMSCRIPTEN_JSPI@
|
||||||
export ENABLE_EMSCRIPTEN_PROXY_POSIX_SOCKETS=@ENABLE_EMSCRIPTEN_PROXY_POSIX_SOCKETS@
|
export ENABLE_EMSCRIPTEN_PROXY_POSIX_SOCKETS=@ENABLE_EMSCRIPTEN_PROXY_POSIX_SOCKETS@
|
||||||
export ENABLE_EMSCRIPTEN_PROXY_TO_PTHREAD=@ENABLE_EMSCRIPTEN_PROXY_TO_PTHREAD@
|
export ENABLE_EMSCRIPTEN_PROXY_TO_PTHREAD=@ENABLE_EMSCRIPTEN_PROXY_TO_PTHREAD@
|
||||||
export ENABLE_EPOXY=@ENABLE_EPOXY@
|
export ENABLE_EPOXY=@ENABLE_EPOXY@
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#define HAVE_EMSCRIPTEN_JSPI 0
|
||||||
|
|
||||||
#define HAVE_EMSCRIPTEN_PROXY_POSIX_SOCKETS 0
|
#define HAVE_EMSCRIPTEN_PROXY_POSIX_SOCKETS 0
|
||||||
|
|
||||||
#define HAVE_EMSCRIPTEN_PROXY_TO_PTHREAD 0
|
#define HAVE_EMSCRIPTEN_PROXY_TO_PTHREAD 0
|
||||||
|
16
configure.ac
16
configure.ac
@ -2180,6 +2180,14 @@ AC_ARG_WITH(main-module,
|
|||||||
Default value is 'writer'.]),
|
Default value is 'writer'.]),
|
||||||
,)
|
,)
|
||||||
|
|
||||||
|
if test "$_os" = Emscripten; then
|
||||||
|
AC_ARG_ENABLE(emscripten-jspi,
|
||||||
|
AS_HELP_STRING([--enable-emscripten-jspi],
|
||||||
|
[Experimentally enable use of the Emscripten -sJSPI feature.]))
|
||||||
|
else
|
||||||
|
enable_emscripten_jspi=
|
||||||
|
fi
|
||||||
|
|
||||||
if test "$_os" = Emscripten; then
|
if test "$_os" = Emscripten; then
|
||||||
AC_ARG_ENABLE(emscripten-proxy-to-pthread,
|
AC_ARG_ENABLE(emscripten-proxy-to-pthread,
|
||||||
AS_HELP_STRING([--disable-emscripten-proxy-to-pthread],
|
AS_HELP_STRING([--disable-emscripten-proxy-to-pthread],
|
||||||
@ -4199,6 +4207,14 @@ AC_SUBST(ENABLE_WASM_STRIP)
|
|||||||
AC_SUBST(ENABLE_WASM_STRIP_WRITER)
|
AC_SUBST(ENABLE_WASM_STRIP_WRITER)
|
||||||
AC_SUBST(ENABLE_WASM_STRIP_CALC)
|
AC_SUBST(ENABLE_WASM_STRIP_CALC)
|
||||||
|
|
||||||
|
if test "$enable_emscripten_jspi" = yes; then
|
||||||
|
ENABLE_EMSCRIPTEN_JSPI=TRUE
|
||||||
|
AC_DEFINE(HAVE_EMSCRIPTEN_JSPI)
|
||||||
|
else
|
||||||
|
ENABLE_EMSCRIPTEN_JSPI=
|
||||||
|
fi
|
||||||
|
AC_SUBST(ENABLE_EMSCRIPTEN_JSPI)
|
||||||
|
|
||||||
if test "$enable_emscripten_proxy_to_pthread" = yes; then
|
if test "$enable_emscripten_proxy_to_pthread" = yes; then
|
||||||
ENABLE_EMSCRIPTEN_PROXY_TO_PTHREAD=TRUE
|
ENABLE_EMSCRIPTEN_PROXY_TO_PTHREAD=TRUE
|
||||||
AC_DEFINE(HAVE_EMSCRIPTEN_PROXY_TO_PTHREAD)
|
AC_DEFINE(HAVE_EMSCRIPTEN_PROXY_TO_PTHREAD)
|
||||||
|
@ -30,6 +30,10 @@ gb_EMSCRIPTEN_LDFLAGS += -sSTACK_SIZE=131072 -sDEFAULT_PTHREAD_STACK_SIZE=65536
|
|||||||
gb_EMSCRIPTEN_LDFLAGS += --bind -s FORCE_FILESYSTEM=1 -s WASM_BIGINT=1 -s ERROR_ON_UNDEFINED_SYMBOLS=1 -s FETCH=1 -s ASSERTIONS=1 -s EXIT_RUNTIME=0 -s EXPORTED_RUNTIME_METHODS=["UTF16ToString","stringToUTF16","UTF8ToString","ccall","cwrap","addOnPreMain","addOnPostRun","registerType","throwBindingError"$(if $(ENABLE_QT6),$(COMMA)"FS"$(COMMA)"callMain"$(COMMA)"specialHTMLTargets")]
|
gb_EMSCRIPTEN_LDFLAGS += --bind -s FORCE_FILESYSTEM=1 -s WASM_BIGINT=1 -s ERROR_ON_UNDEFINED_SYMBOLS=1 -s FETCH=1 -s ASSERTIONS=1 -s EXIT_RUNTIME=0 -s EXPORTED_RUNTIME_METHODS=["UTF16ToString","stringToUTF16","UTF8ToString","ccall","cwrap","addOnPreMain","addOnPostRun","registerType","throwBindingError"$(if $(ENABLE_QT6),$(COMMA)"FS"$(COMMA)"callMain"$(COMMA)"specialHTMLTargets")]
|
||||||
gb_EMSCRIPTEN_QTDEFS := -DQT_NO_LINKED_LIST -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB
|
gb_EMSCRIPTEN_QTDEFS := -DQT_NO_LINKED_LIST -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB
|
||||||
|
|
||||||
|
ifeq ($(ENABLE_EMSCRIPTEN_JSPI),TRUE)
|
||||||
|
gb_EMSCRIPTEN_LDFLAGS += -sJSPI
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(ENABLE_EMSCRIPTEN_PROXY_POSIX_SOCKETS),TRUE)
|
ifeq ($(ENABLE_EMSCRIPTEN_PROXY_POSIX_SOCKETS),TRUE)
|
||||||
gb_EMSCRIPTEN_LDFLAGS += -sPROXY_POSIX_SOCKETS -lwebsocket.js
|
gb_EMSCRIPTEN_LDFLAGS += -sPROXY_POSIX_SOCKETS -lwebsocket.js
|
||||||
endif
|
endif
|
||||||
|
@ -53,6 +53,7 @@
|
|||||||
#include <vclpluginapi.h>
|
#include <vclpluginapi.h>
|
||||||
#include <tools/debug.hxx>
|
#include <tools/debug.hxx>
|
||||||
#include <comphelper/flagguard.hxx>
|
#include <comphelper/flagguard.hxx>
|
||||||
|
#include <config_emscripten.h>
|
||||||
#include <config_vclplug.h>
|
#include <config_vclplug.h>
|
||||||
#include <dndhelper.hxx>
|
#include <dndhelper.hxx>
|
||||||
#include <vcl/qt/QtUtils.hxx>
|
#include <vcl/qt/QtUtils.hxx>
|
||||||
@ -298,7 +299,7 @@ QtInstance::QtInstance(std::unique_ptr<QApplication>& pQApp)
|
|||||||
|
|
||||||
#ifndef EMSCRIPTEN
|
#ifndef EMSCRIPTEN
|
||||||
m_bSupportsOpenGL = true;
|
m_bSupportsOpenGL = true;
|
||||||
#else
|
#elif !HAVE_EMSCRIPTEN_JSPI
|
||||||
ImplGetSVData()->maAppData.m_bUseSystemLoop = true;
|
ImplGetSVData()->maAppData.m_bUseSystemLoop = true;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user