From 8c9c1b41e1403bcd69a4de4c1807da12ee3d7329 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Fri, 26 Oct 2018 15:50:55 +0200 Subject: Doc: add section on dynamic and statically-built Qt projects It's currently not documented how to have a library that can be both dynamically and statically linked to an application. Change-Id: Ic9130ccb7f8b476d6d91231e4eacef2caadcf1d1 Reviewed-by: Christian Kandeler --- doc/howtos.qdoc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/doc/howtos.qdoc b/doc/howtos.qdoc index afd3c0962..7ef1fc086 100644 --- a/doc/howtos.qdoc +++ b/doc/howtos.qdoc @@ -110,6 +110,21 @@ The product definitions would stay exactly the same. In particular, their location in the project tree is irrelevant to the relationship between them. + \section2 Choosing Between Dynamic and Statically-built Qt Projects + + To build \c "the-lib" as either a dynamic or static library, depending on + how Qt was built, you can use the following code: + + \code + Product { + name: "the-lib" + type: Qt.core.staticBuild ? "staticlibrary" : "dynamiclibrary" + + Depends { name: "Qt.core" } + // ... + } + \endcode + \section1 How do I use precompiled headers? If you use a \l Group item to add a precompiled header file to a product -- cgit v1.2.3