summaryrefslogtreecommitdiffstats
path: root/examples/applicationmanager/application-features/doc
diff options
context:
space:
mode:
authorRobert Griebl <robert.griebl@qt.io>2022-06-29 14:19:07 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-06-30 20:52:59 +0000
commita26f5d83c4a079207f0d3cbe4b78507fc2ddf437 (patch)
tree2510311d5ce7220b4d7990473e797ba37c1b33cc /examples/applicationmanager/application-features/doc
parentc344046075fa3359dd4c70e92253f2edc5368579 (diff)
Prevent linking of AppMan modules into user plugins
As the AppMan modules are static libraries, linking any of them into a QML plugin (that later gets loaded into the system-ui) will lead to a bunch of problems: 1) due to symbol duplication and duplicate static data, a lot of singletons may exist twice 2) all static constructors (logging, crash-handling, etc.) are run a second time, overriding any custom configuration that was applied after config parsing. If you are legitimately building a custom appman binary, a custom launcher or a native app using launcher-lib, you need to flag this via compile-time defines now: Either AM_COMPILING_APPMAN or AM_COMPILING_LAUNCHER AM_COMPILING_LAUNCHER is also used for native apps using launcher-lib. Change-Id: I0c1a3fb7e0c7121f92d44c764c2c1eeb720e7041 Reviewed-by: Dominik Holland <dominik.holland@qt.io> (cherry picked from commit a1c90ed4605b08c39d380d2605d26b684d340c64) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'examples/applicationmanager/application-features/doc')
-rw-r--r--examples/applicationmanager/application-features/doc/src/application-features.qdoc8
1 files changed, 8 insertions, 0 deletions
diff --git a/examples/applicationmanager/application-features/doc/src/application-features.qdoc b/examples/applicationmanager/application-features/doc/src/application-features.qdoc
index a2ccb99b..ed9afad1 100644
--- a/examples/applicationmanager/application-features/doc/src/application-features.qdoc
+++ b/examples/applicationmanager/application-features/doc/src/application-features.qdoc
@@ -93,6 +93,14 @@ needs a \c type window property to differentiate between normal windows and popu
This application only works in multi-process mode, as application processes cannot be started in
single-process mode.
+Linking against the private application manager modules is prohibited by default to prevent
+potential problems with duplicate symbols coming from QML plugins. However here building against
+them is both intended and required, so we need to set the define \c AM_COMPILING_LAUNCHER:
+
+\quotefromfile applicationmanager/application-features/native/widgets/CMakeLists.txt
+\skipuntil /allows us to link against/
+\printuntil /AM_COMPILING_LAUNCHER/
+
The C++ code for the native widgets application is as follows:
\quotefromfile applicationmanager/application-features/native/widgets/main.cpp