summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorArmin Le Grand (Allotropia) <Armin.Le.Grand@me.com>2021-04-30 17:26:41 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2022-01-20 12:28:54 +0100
commit02140554ee1d70b219a42546191e2219d58be4b0 (patch)
tree3dd419dbdd0c23676c7f749bd8a83d09ad26c8bd /desktop
parent02634fb7c7e8dc613ffc3717bb244f85cf81a7c6 (diff)
WASM --enable-wasm-strip now skips lots of LO code
... resulting in a stripped-down, Writer-only build to decrease the resulting WASM bytecode size. It removes the following code from the build: * All other major modules: Base, Calc, Chart, Draw, Impress and Math and related writerperfect filters * The premultiply tables * The (auto-)recovery functionality * All accessibility (but not the accessibility document checker) * The LanguageGuess component * EPUB support * The start center / BackingWindow * The TipOfTheDay functionality * The splash screen communication Currently crashs with anything different then soffice --writer. Closing the document also still crashes. FYI: many of these features are now behind ENABLE_WASM_STRIP_* defines, but they normally don't work on their own, globally! That's because we started with stripping the main components. Change-Id: Ib9c0f9452815910c0a2aceaf142ba1ad4a9cb0d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126182 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/Module_desktop.mk4
-rw-r--r--desktop/source/app/app.cxx31
2 files changed, 32 insertions, 3 deletions
diff --git a/desktop/Module_desktop.mk b/desktop/Module_desktop.mk
index 191a2cba4c6f..d160bc6128dc 100644
--- a/desktop/Module_desktop.mk
+++ b/desktop/Module_desktop.mk
@@ -20,7 +20,7 @@ $(eval $(call gb_Module_add_targets,desktop,\
$(if $(ENABLE_BREAKPAD), \
Library_crashreport \
) \
- $(if $(DISABLE_GUI),,Library_spl) \
+ $(if $(or $(DISABLE_GUI),$(ENABLE_WASM_STRIP_SPLASH)),,Library_spl) \
Package_branding \
$(if $(CUSTOM_BRAND_DIR),Package_branding_custom) \
UIConfig_deployment \
@@ -103,7 +103,7 @@ $(eval $(call gb_Module_add_targets,desktop,\
))
endif
-endif
+endif # $(OS)
ifneq (,$(filter Extension_test-active,$(MAKECMDGOALS)))
$(eval $(call gb_Module_add_targets,desktop, \
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 32d5b31278c1..b14c0d94299a 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -24,6 +24,7 @@
#include <config_java.h>
#include <config_folders.h>
#include <config_extensions.h>
+#include <config_wasm_strip.h>
#include <sal/config.h>
@@ -99,7 +100,9 @@
#include <osl/process.h>
#include <rtl/byteseq.hxx>
#include <unotools/pathoptions.hxx>
+#if !ENABLE_WASM_STRIP_PINGUSER
#include <unotools/VersionConfig.hxx>
+#endif
#include <rtl/bootstrap.hxx>
#include <vcl/test/GraphicsRenderTests.hxx>
#include <vcl/glxtestprocess.hxx>
@@ -339,10 +342,12 @@ namespace {
void runGraphicsRenderTests()
{
+#if !ENABLE_WASM_STRIP_PINGUSER
if (!utl::isProductVersionUpgraded(false))
{
return;
}
+#endif
GraphicsRenderTests TestObject;
TestObject.run();
}
@@ -967,6 +972,7 @@ struct RefClearGuard
@param bEmergencySave
differs between EMERGENCY_SAVE and RECOVERY
*/
+#if !ENABLE_WASM_STRIP_RECOVERYUI
bool impl_callRecoveryUI(bool bEmergencySave ,
bool bExistsRecoveryData)
{
@@ -998,6 +1004,7 @@ bool impl_callRecoveryUI(bool bEmergencySave ,
aRet >>= bRet;
return bRet;
}
+#endif
bool impl_bringToFrontRecoveryUI()
{
@@ -1146,9 +1153,11 @@ void Desktop::Exception(ExceptionCategory nCategory)
// Save all open documents so they will be reopened
// the next time the application is started
// returns true if at least one document could be saved...
+#if !ENABLE_WASM_STRIP_RECOVERYUI
bRestart = impl_callRecoveryUI(
true , // force emergency save
false);
+#endif
}
FlushConfiguration();
@@ -1162,8 +1171,10 @@ void Desktop::Exception(ExceptionCategory nCategory)
osl_removeSignalHandler( pSignalHandler );
restartOnMac(false);
+#if !ENABLE_WASM_STRIP_SPLASH
if ( m_rSplashScreen.is() )
m_rSplashScreen->reset();
+#endif
_exit( EXITHELPER_CRASH_WITH_RESTART );
}
@@ -1266,7 +1277,9 @@ int Desktop::Main()
Translate::SetReadStringHook(ReplaceStringHookProc);
// Startup screen
+#if !ENABLE_WASM_STRIP_SPLASH
OpenSplashScreen();
+#endif
SetSplashScreenProgress(10);
@@ -1702,8 +1715,10 @@ int Desktop::doShutdown()
if ( bRR )
{
restartOnMac(true);
+#if !ENABLE_WASM_STRIP_SPLASH
if ( m_rSplashScreen.is() )
m_rSplashScreen->reset();
+#endif
return EXITHELPER_NORMAL_RESTART;
}
@@ -1999,8 +2014,9 @@ void Desktop::OpenClients()
}
else
{
- bool bCrashed = false;
bool bExistsRecoveryData = false;
+#if !ENABLE_WASM_STRIP_RECOVERYUI
+ bool bCrashed = false;
bool bExistsSessionData = false;
bool const bDisableRecovery
= getenv("OOO_DISABLE_RECOVERY") != nullptr
@@ -2026,6 +2042,7 @@ void Desktop::OpenClients()
TOOLS_WARN_EXCEPTION( "desktop.app", "Error during recovery");
}
}
+#endif
Reference< XSessionManagerListener2 > xSessionListener;
try
@@ -2384,6 +2401,7 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent )
}
}
+#if !ENABLE_WASM_STRIP_SPLASH
void Desktop::OpenSplashScreen()
{
const CommandLineArgs &rCmdLine = GetCommandLineArgs();
@@ -2433,31 +2451,42 @@ void Desktop::OpenSplashScreen()
m_rSplashScreen->start("SplashScreen", 100);
}
+#endif
void Desktop::SetSplashScreenProgress(sal_Int32 iProgress)
{
+#if ENABLE_WASM_STRIP_SPLASH
+ (void) iProgress;
+#else
if(m_rSplashScreen.is())
{
m_rSplashScreen->setValue(iProgress);
}
+#endif
}
void Desktop::SetSplashScreenText( const OUString& rText )
{
+#if ENABLE_WASM_STRIP_SPLASH
+ (void) rText;
+#else
if( m_rSplashScreen.is() )
{
m_rSplashScreen->setText( rText );
}
+#endif
}
void Desktop::CloseSplashScreen()
{
+#if !ENABLE_WASM_STRIP_SPLASH
if(m_rSplashScreen.is())
{
SolarMutexGuard ensureSolarMutex;
m_rSplashScreen->end();
m_rSplashScreen = nullptr;
}
+#endif
}