diff options
-rw-r--r-- | Repository.mk | 1 | ||||
-rw-r--r-- | desktop/Executable_soffice_bin.mk | 13 | ||||
-rw-r--r-- | solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk | 2 | ||||
-rw-r--r-- | static/CustomTarget_unoembind.mk | 6 | ||||
-rw-r--r-- | static/StaticLibrary_unoembind.mk | 6 | ||||
-rw-r--r-- | unotest/InternalUnoApi_embindtest.mk | 16 | ||||
-rw-r--r-- | unotest/Library_embindtest.mk | 26 | ||||
-rw-r--r-- | unotest/Module_unotest.mk | 7 | ||||
-rw-r--r-- | unotest/source/embindtest/embindtest.component | 20 | ||||
-rw-r--r-- | unotest/source/embindtest/embindtest.cxx | 38 | ||||
-rw-r--r-- | unotest/source/embindtest/embindtest.idl | 18 | ||||
-rw-r--r-- | unotest/source/embindtest/embindtest.js | 18 |
12 files changed, 168 insertions, 3 deletions
diff --git a/Repository.mk b/Repository.mk index 29e2b00e0d45..814ca2edb77b 100644 --- a/Repository.mk +++ b/Repository.mk @@ -408,6 +408,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \ drawinglayercore \ drawinglayer \ editeng \ + $(if $(filter EMSCRIPTEN,$(OS)),$(if $(ENABLE_DBGUTIL),embindtest)) \ $(if $(filter WNT,$(OS)),emser) \ evtatt \ $(call gb_Helper_optional,DBCONNECTIVITY, \ diff --git a/desktop/Executable_soffice_bin.mk b/desktop/Executable_soffice_bin.mk index ad391b3dbc19..34146dc5bfe9 100644 --- a/desktop/Executable_soffice_bin.mk +++ b/desktop/Executable_soffice_bin.mk @@ -64,6 +64,19 @@ $(eval $(call gb_Executable_add_ldflags,soffice_bin, \ )) endif +ifneq ($(ENABLE_DBGUTIL),) + +$(call gb_Executable_get_linktarget_target,soffice_bin): \ + $(call gb_CustomTarget_get_workdir,static/unoembind)/bindings_uno.js \ + $(SRCDIR)/unotest/source/embindtest/embindtest.js + +$(eval $(call gb_Executable_add_ldflags,soffice_bin, \ + --post-js $(call gb_CustomTarget_get_workdir,static/unoembind)/bindings_uno.js \ + --post-js $(SRCDIR)/unotest/source/embindtest/embindtest.js \ +)) + +endif + endif # vim: set ts=4 sw=4 et: diff --git a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk index 8a36e425ce7a..ec762431097f 100644 --- a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk +++ b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk @@ -27,7 +27,7 @@ gb_EMSCRIPTEN_LDFLAGS += -s TOTAL_MEMORY=1GB -s PTHREAD_POOL_SIZE=4 # To keep the link time (and memory) down, prevent all rewriting options from wasm-emscripten-finalize # See emscripten.py, finalize_wasm, modify_wasm = True # So we need WASM_BIGINT=1 and ASSERTIONS=1 (2 implies STACK_OVERFLOW_CHECK) -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","allocateUTF8","printErr","ccall","cwrap","addOnPreMain","registerType","throwBindingError"$(if $(ENABLE_QT6),$(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","allocateUTF8","printErr","ccall","cwrap","addOnPreMain"$(if $(ENABLE_DBGUTIL),$(COMMA)"addOnPostRun"),"registerType","throwBindingError"$(if $(ENABLE_QT6),$(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_Executable_EXT := .html diff --git a/static/CustomTarget_unoembind.mk b/static/CustomTarget_unoembind.mk index cccb36f1dce2..045e0fea511c 100644 --- a/static/CustomTarget_unoembind.mk +++ b/static/CustomTarget_unoembind.mk @@ -17,10 +17,12 @@ $(eval $(call gb_CustomTarget_register_targets,static/unoembind, \ $(call gb_CustomTarget_get_workdir,static/unoembind)/bindings_uno.cxx \ $(call gb_CustomTarget_get_workdir,static/unoembind)/bindings_uno.js: \ $(call gb_Executable_get_target_for_build,embindmaker) $(call gb_UnoApi_get_target,udkapi) \ - $(call gb_UnoApi_get_target,offapi) + $(call gb_UnoApi_get_target,offapi) \ + $(if $(ENABLE_DBGUTIL),$(call gb_UnoApiTarget_get_target,embindtest)) $(call gb_Executable_get_command,embindmaker) uno \ $(call gb_CustomTarget_get_workdir,static/unoembind)/bindings_uno.cxx \ $(call gb_CustomTarget_get_workdir,static/unoembind)/bindings_uno.js \ - +$(call gb_UnoApi_get_target,udkapi) +$(call gb_UnoApi_get_target,offapi) + +$(call gb_UnoApi_get_target,udkapi) +$(call gb_UnoApi_get_target,offapi) \ + +$(if $(ENABLE_DBGUTIL),$(call gb_UnoApiTarget_get_target,embindtest)) # vim: set noet sw=4 ts=4: diff --git a/static/StaticLibrary_unoembind.mk b/static/StaticLibrary_unoembind.mk index e2a2bfacd892..5d4438ef2f85 100644 --- a/static/StaticLibrary_unoembind.mk +++ b/static/StaticLibrary_unoembind.mk @@ -22,6 +22,12 @@ $(eval $(call gb_StaticLibrary_use_api,unoembind,\ udkapi \ )) +ifneq ($(ENABLE_DBGUTIL),) +$(eval $(call gb_StaticLibrary_use_internal_api,unoembind, \ + embindtest \ +)) +endif + $(call gb_StaticLibrary_get_target,unoembind): $(call gb_CustomTarget_get_target,static/unoembind) # vim: set noet sw=4 ts=4: diff --git a/unotest/InternalUnoApi_embindtest.mk b/unotest/InternalUnoApi_embindtest.mk new file mode 100644 index 000000000000..ed96a209ce81 --- /dev/null +++ b/unotest/InternalUnoApi_embindtest.mk @@ -0,0 +1,16 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t; 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/. +# + +$(eval $(call gb_InternalUnoApi_InternalUnoApi,embindtest,unotest/source/embindtest/embindtest.idl)) + +$(eval $(call gb_InternalUnoApi_use_api,embindtest, \ + udkapi \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/unotest/Library_embindtest.mk b/unotest/Library_embindtest.mk new file mode 100644 index 000000000000..8c2d48bbfac9 --- /dev/null +++ b/unotest/Library_embindtest.mk @@ -0,0 +1,26 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t; 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/. +# + +$(eval $(call gb_Library_Library,embindtest)) + +$(eval $(call gb_Library_add_exception_objects,embindtest, \ + unotest/source/embindtest/embindtest \ +)) + +$(eval $(call gb_Library_set_componentfile,embindtest,unotest/source/embindtest/embindtest,services)) + +$(eval $(call gb_Library_use_api,embindtest, \ + udkapi \ +)) + +$(eval $(call gb_Library_use_internal_api,embindtest, \ + embindtest \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/unotest/Module_unotest.mk b/unotest/Module_unotest.mk index bdffe8e8ac14..a12267817d27 100644 --- a/unotest/Module_unotest.mk +++ b/unotest/Module_unotest.mk @@ -30,6 +30,13 @@ $(eval $(call gb_Module_add_targets,unotest,\ )) endif endif + +ifeq ($(OS)-$(ENABLE_DBGUTIL),EMSCRIPTEN-TRUE) +$(eval $(call gb_Module_add_targets,unotest, \ + InternalUnoApi_embindtest \ + Library_embindtest \ +)) +endif endif # vim: set noet sw=4 ts=4: diff --git a/unotest/source/embindtest/embindtest.component b/unotest/source/embindtest/embindtest.component new file mode 100644 index 000000000000..57a89249e8c0 --- /dev/null +++ b/unotest/source/embindtest/embindtest.component @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * 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/. + * +--> + +<component + environment="@CPPU_ENV@" + loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation + constructor="org_libreoffice_comp_embindtest_Test_get_implementation" + name="org.libreoffice.comp.embindtest.Test"> + <singleton name="org.libreoffice.embindtest.Test"/> + </implementation> +</component> diff --git a/unotest/source/embindtest/embindtest.cxx b/unotest/source/embindtest/embindtest.cxx new file mode 100644 index 000000000000..bc8db7d5c9b4 --- /dev/null +++ b/unotest/source/embindtest/embindtest.cxx @@ -0,0 +1,38 @@ +/* -*- Mode: C++; 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/. + */ + +#include <sal/config.h> + +#include <com/sun/star/uno/Sequence.hxx> +#include <cppuhelper/implbase.hxx> +#include <cppuhelper/weak.hxx> +#include <org/libreoffice/embindtest/XTest.hpp> +#include <sal/types.h> + +namespace com::sun::star::uno +{ +class Any; +class XComponentContext; +} + +namespace +{ +class Test : public cppu::WeakImplHelper<org::libreoffice::embindtest::XTest> +{ +}; +} + +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* +org_libreoffice_comp_embindtest_Test_get_implementation(css::uno::XComponentContext*, + css::uno::Sequence<css::uno::Any> const&) +{ + return cppu::acquire(new Test); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/unotest/source/embindtest/embindtest.idl b/unotest/source/embindtest/embindtest.idl new file mode 100644 index 000000000000..553fe6ac38d3 --- /dev/null +++ b/unotest/source/embindtest/embindtest.idl @@ -0,0 +1,18 @@ +/* -*- Mode: C++; 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/. + */ + +module org { module libreoffice { module embindtest { + +interface XTest {}; + +singleton Test: XTest; + +}; }; }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/unotest/source/embindtest/embindtest.js b/unotest/source/embindtest/embindtest.js new file mode 100644 index 000000000000..ad5eeea29075 --- /dev/null +++ b/unotest/source/embindtest/embindtest.js @@ -0,0 +1,18 @@ +/* -*- 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/. + */ + +Module.addOnPostRun(function() { + console.log('Running embindtest'); + init_unoembind_uno(Module); + let test = new Module.unoembind_uno.org.libreoffice.embindtest.Test( + Module.getUnoComponentContext()); + console.assert(typeof test === 'object'); +}); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ |