move HAVE_FEATURE_DESKTOP/OPENCL to their dedicated headers
HAVE_FEATURE_OPENCL is included by a common Calc header
and HAVE_FEATURE_DESKTOP is included by a common Writer header,
causing pretty much their full rebuilds if any feature changes.
Change-Id: If29bf78bd4fd70b37981e0826a577777fd255c89
Reviewed-on: https://gerrit.libreoffice.org/80776
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@collabora.com>
diff --git a/accessibility/source/helper/acc_factory.cxx b/accessibility/source/helper/acc_factory.cxx
index 48458e8..076b865 100644
--- a/accessibility/source/helper/acc_factory.cxx
+++ b/accessibility/source/helper/acc_factory.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <config_features.h>
#include <config_feature_desktop.h>
#include <toolkit/awt/vclxwindows.hxx>
#include <toolkit/helper/accessiblefactory.hxx>
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index 6824c4f..8601e82 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <config_features.h>
#include <config_feature_desktop.h>
#include <ChartView.hxx>
#include <chartview/DrawModelWrapper.hxx>
diff --git a/config_host/config_feature_desktop.h.in b/config_host/config_feature_desktop.h.in
new file mode 100644
index 0000000..489f684
--- /dev/null
+++ b/config_host/config_feature_desktop.h.in
@@ -0,0 +1,28 @@
/* A feature split out from config_features.h because it affects many files.
*/
#ifndef CONFIG_FEATURE_DESKTOP_H
#define CONFIG_FEATURE_DESKTOP_H
/* DESKTOP - Whether we have a "normal" desktop UI or not.
*
* Non-DESKTOP in practice means touch-based mobile devices, Android
* or iOS for now. Support for those is work in progress.
*
* Non-DESKTOP implies that the OS makes sure that only one instance
* of each LibreOffice-based "app" at a time can be running, and thus
* the LibreOffice code does not need to handle such things itself.
*
* Non-DESKTOP implies no traditional inter-app drag and drop concept.
*
* Non-DESKTOP implies no traditional help mechanism, and to some
* extent (as noticed, and as possible without making the code too
* ugly) the related code is ifdeffed out.
*
* Non-DESKTOP implies no traditional desktop-style GUI elements like
* toolbars and scrollbars presented by the LO code.
*/
#define HAVE_FEATURE_DESKTOP 0
#endif
diff --git a/config_host/config_feature_opencl.h.in b/config_host/config_feature_opencl.h.in
new file mode 100644
index 0000000..637c15a
--- /dev/null
+++ b/config_host/config_feature_opencl.h.in
@@ -0,0 +1,13 @@
/* A feature split out from config_features.h because it affects many files.
*/
#ifndef CONFIG_FEATURE_OPENCL_H
#define CONFIG_FEATURE_OPENCL_H
/*
* Whether OpenCL is usable on the platform and we should compile in use of OpenCL.
*/
#define HAVE_FEATURE_OPENCL 0
#endif
diff --git a/config_host/config_features.h.in b/config_host/config_features.h.in
index a680501..9053656 100644
--- a/config_host/config_features.h.in
+++ b/config_host/config_features.h.in
@@ -7,27 +7,6 @@
#ifndef CONFIG_FEATURES_H
#define CONFIG_FEATURES_H
/* DESKTOP - Whether we have a "normal" desktop UI or not.
*
* Non-DESKTOP in practice means touch-based mobile devices, Android
* or iOS for now. Support for those is work in progress.
*
* Non-DESKTOP implies that the OS makes sure that only one instance
* of each LibreOffice-based "app" at a time can be running, and thus
* the LibreOffice code does not need to handle such things itself.
*
* Non-DESKTOP implies no traditional inter-app drag and drop concept.
*
* Non-DESKTOP implies no traditional help mechanism, and to some
* extent (as noticed, and as possible without making the code too
* ugly) the related code is ifdeffed out.
*
* Non-DESKTOP implies no traditional desktop-style GUI elements like
* toolbars and scrollbars presented by the LO code.
*/
#define HAVE_FEATURE_DESKTOP 0
/* X11
*
* Whether we are building code to run in an X11 environment.
@@ -73,12 +52,6 @@
#define HAVE_FEATURE_MULTIUSER_ENVIRONMENT 0
/*
* Whether OpenCL is usable on the platform and we should compile in use of OpenCL.
*/
#define HAVE_FEATURE_OPENCL 0
/*
* Whether the OS has Avahi support,
* This library is used for zeroconf service publication on the local network
* for the Impress remote control, so that the remote can automatically
diff --git a/configure.ac b/configure.ac
index a0c69e8..40f23dc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12862,6 +12862,8 @@ AC_CONFIG_HEADERS([config_host/config_cairo_canvas.h])
AC_CONFIG_HEADERS([config_host/config_cxxabi.h])
AC_CONFIG_HEADERS([config_host/config_dbus.h])
AC_CONFIG_HEADERS([config_host/config_features.h])
AC_CONFIG_HEADERS([config_host/config_feature_desktop.h])
AC_CONFIG_HEADERS([config_host/config_feature_opencl.h])
AC_CONFIG_HEADERS([config_host/config_firebird.h])
AC_CONFIG_HEADERS([config_host/config_folders.h])
AC_CONFIG_HEADERS([config_host/config_fuzzers.h])
diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index 06ead11..614c559 100644
--- a/cui/source/dialogs/about.cxx
+++ b/cui/source/dialogs/about.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <config_features.h>
#include <config_feature_opencl.h>
#include <osl/process.h>
#include <sal/log.hxx>
#include <osl/diagnose.h>
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index b923e4b..f36a8ab 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -19,6 +19,8 @@
#include <memory>
#include <config_features.h>
#include <config_feature_opencl.h>
#include <config_feature_desktop.h>
#include <config_gpgme.h>
#include <svx/dialogs.hrc>
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index b39f693..4f68f9e 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -19,6 +19,8 @@
#include <memory>
#include <config_features.h>
#include <config_feature_desktop.h>
#include <config_feature_opencl.h>
#include <config_java.h>
#include <config_folders.h>
#include <config_extensions.h>
diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx
index 679d95f..e375c17 100644
--- a/desktop/source/app/officeipcthread.cxx
+++ b/desktop/source/app/officeipcthread.cxx
@@ -21,6 +21,7 @@
#include <config_dbus.h>
#include <config_features.h>
#include <config_feature_desktop.h>
#include <app.hxx>
#include "officeipcthread.hxx"
diff --git a/desktop/source/app/opencl.cxx b/desktop/source/app/opencl.cxx
index 34e4d59..6edb7c0 100644
--- a/desktop/source/app/opencl.cxx
+++ b/desktop/source/app/opencl.cxx
@@ -15,7 +15,7 @@
#include <app.hxx>
#include <config_version.h>
#include <config_features.h>
#include <config_feature_opencl.h>
#include <config_folders.h>
#include <rtl/bootstrap.hxx>
diff --git a/desktop/source/deployment/registry/help/dp_help.cxx b/desktop/source/deployment/registry/help/dp_help.cxx
index 2d9107d..5d2541a 100644
--- a/desktop/source/deployment/registry/help/dp_help.cxx
+++ b/desktop/source/deployment/registry/help/dp_help.cxx
@@ -18,7 +18,7 @@
*/
#include <memory>
#include <config_features.h>
#include <config_feature_desktop.h>
#include <strings.hrc>
#include <dp_backend.h>
diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx
index 7afceb8..c077807 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -18,7 +18,7 @@
*/
#include <memory>
#include <config_features.h>
#include <config_feature_desktop.h>
#include <services/layoutmanager.hxx>
#include "helpers.hxx"
diff --git a/sc/inc/formulagroup.hxx b/sc/inc/formulagroup.hxx
index 8776552..8cdc978 100644
--- a/sc/inc/formulagroup.hxx
+++ b/sc/inc/formulagroup.hxx
@@ -10,7 +10,7 @@
#ifndef INCLUDED_SC_INC_FORMULAGROUP_HXX
#define INCLUDED_SC_INC_FORMULAGROUP_HXX
#include <config_features.h>
#include <config_feature_opencl.h>
#include "address.hxx"
#include "calcconfig.hxx"
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index 78fd4a7..572353c 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <config_features.h>
#include <config_feature_opencl.h>
#include <sal/config.h>
#include <sal/log.hxx>
diff --git a/sc/source/core/tool/formulagroup.cxx b/sc/source/core/tool/formulagroup.cxx
index 79d1cf1..76b29ea 100644
--- a/sc/source/core/tool/formulagroup.cxx
+++ b/sc/source/core/tool/formulagroup.cxx
@@ -7,7 +7,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <config_features.h>
#include <config_feature_opencl.h>
#include <formulagroup.hxx>
#include <formulagroupcl.hxx>
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 0fce15e..770c828 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -19,6 +19,7 @@
#include <docsh.hxx>
#include <config_features.h>
#include <scitems.hxx>
#include <sc.hrc>
#include <vcl/errinf.hxx>
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index e312f9e..be9cc50 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <config_features.h>
#include <config_feature_opencl.h>
#include <boost/property_tree/json_parser.hpp>
diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx
index 61d2733..fdde597 100644
--- a/sc/source/ui/view/viewfun4.cxx
+++ b/sc/source/ui/view/viewfun4.cxx
@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <config_features.h>
#include <memory>
#include <editeng/eeitem.hxx>
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index a8a5b58..33750b9 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <config_features.h>
#include <config_feature_desktop.h>
#include <sal/log.hxx>
#include <osl/module.hxx>
diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx
index 4210098..d559183 100644
--- a/sfx2/source/appl/workwin.cxx
+++ b/sfx2/source/appl/workwin.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <config_features.h>
#include <config_feature_desktop.h>
#include <comphelper/lok.hxx>
#include <comphelper/processfactory.hxx>
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index e7cf277..246a10d 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <config_features.h>
#include <config_feature_desktop.h>
#include <algorithm>
#include <deque>
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 3540e91..19b3590 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <config_features.h>
#include <config_feature_desktop.h>
#include <osl/file.hxx>
#include <sfx2/docfilt.hxx>
#include <sfx2/infobar.hxx>
diff --git a/svx/source/sdr/contact/objectcontactofpageview.cxx b/svx/source/sdr/contact/objectcontactofpageview.cxx
index b3efeae..5838a16 100644
--- a/svx/source/sdr/contact/objectcontactofpageview.cxx
+++ b/svx/source/sdr/contact/objectcontactofpageview.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <config_features.h>
#include <config_feature_desktop.h>
#include <svx/sdr/contact/objectcontactofpageview.hxx>
#include <sdr/contact/viewobjectcontactofunocontrol.hxx>
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index 9499da1..51c2fd5 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -22,7 +22,7 @@
#include <map>
#include <vector>
#include <config_features.h>
#include <config_feature_desktop.h>
#include <svx/strings.hrc>
#include <svx/dialmgr.hxx>
diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx
index fb068fc..5fca540 100644
--- a/svx/source/unodraw/unopage.cxx
+++ b/svx/source/unodraw/unopage.cxx
@@ -18,6 +18,7 @@
*/
#include <config_features.h>
#include <config_feature_desktop.h>
#include <com/sun/star/document/EventObject.hpp>
#include <com/sun/star/embed/XEmbeddedObject.hpp>
diff --git a/sw/inc/viewopt.hxx b/sw/inc/viewopt.hxx
index 19eb9d5..c727452 100644
--- a/sw/inc/viewopt.hxx
+++ b/sw/inc/viewopt.hxx
@@ -20,7 +20,7 @@
#ifndef INCLUDED_SW_INC_VIEWOPT_HXX
#define INCLUDED_SW_INC_VIEWOPT_HXX
#include <config_features.h>
#include <config_feature_desktop.h>
#include <tools/gen.hxx>
#include <tools/color.hxx>
diff --git a/sw/inc/viscrs.hxx b/sw/inc/viscrs.hxx
index 2361bed..16209bc 100644
--- a/sw/inc/viscrs.hxx
+++ b/sw/inc/viscrs.hxx
@@ -19,7 +19,7 @@
#ifndef INCLUDED_SW_INC_VISCRS_HXX
#define INCLUDED_SW_INC_VISCRS_HXX
#include <config_features.h>
#include <config_feature_desktop.h>
#include <vcl/cursor.hxx>
#include "swcrsr.hxx"
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index 13d72cd..8703385 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -9,6 +9,8 @@
#include <swmodeltestbase.hxx>
#include <config_features.h>
#include <com/sun/star/awt/FontWeight.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
#include <com/sun/star/drawing/BitmapMode.hpp>
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index 7398af4..529932a 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -9,6 +9,8 @@
#include <swmodeltestbase.hxx>
#include <config_features.h>
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/text/XFootnote.hpp>
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index a86987b..82f3211 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -10,6 +10,8 @@
#include <memory>
#include <swmodeltestbase.hxx>
#include <config_features.h>
#include <com/sun/star/awt/FontDescriptor.hpp>
#include <com/sun/star/awt/FontUnderline.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
diff --git a/toolkit/source/helper/accessibilityclient.cxx b/toolkit/source/helper/accessibilityclient.cxx
index fbd29c4..abbd9a7 100644
--- a/toolkit/source/helper/accessibilityclient.cxx
+++ b/toolkit/source/helper/accessibilityclient.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <config_features.h>
#include <config_feature_desktop.h>
#include <sal/config.h>
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index afeaaf6..e032edc 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -76,6 +76,7 @@
#include <displayconnectiondispatch.hxx>
#include <config_features.h>
#include <config_feature_opencl.h>
#include <osl/process.h>
#include <com/sun/star/lang/XComponent.hpp>
diff --git a/vcl/source/helper/svtaccessiblefactory.cxx b/vcl/source/helper/svtaccessiblefactory.cxx
index 460241e..5b966d4 100644
--- a/vcl/source/helper/svtaccessiblefactory.cxx
+++ b/vcl/source/helper/svtaccessiblefactory.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <config_features.h>
#include <config_feature_desktop.h>
#include <vcl/svtaccessiblefactory.hxx>
#include <vcl/accessiblefactory.hxx>
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 389b153..e592a7f 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -7,7 +7,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <config_features.h>
#include <config_feature_desktop.h>
#include <memory>
#include <unordered_map>
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 714141e..f956303 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <config_features.h>
#include <config_feature_desktop.h>
#ifdef IOS
#include <premac.h>
diff --git a/vcl/source/window/mouse.cxx b/vcl/source/window/mouse.cxx
index 1190c6b..a3a06ec 100644
--- a/vcl/source/window/mouse.cxx
+++ b/vcl/source/window/mouse.cxx
@@ -19,6 +19,7 @@
#include <config_features.h>
#include <config_feature_desktop.h>
#include <tools/time.hxx>