From e817ac3d68295fc0670ccede4df08bf1c7e627d2 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 16 Jun 2020 11:54:14 +0200 Subject: Document that Q_INIT_RESOURCE is not necessary for CMake-based projects Since commit e343affd634 we're creating object libraries for Qt resources in static libraries when building Qt or a Qt-based project with CMake. The purpose of this is to remove the need for calling Q_INIT_RESOURCE in static libraries. Add a note to the documentation and a changelog entry. [ChangeLog][CMake] Calling Q_INIT_RESOURCE in static libraries is not strictly necessary anymore for CMake-based projects. There, for each resource, an object library is created which is linked into consuming projects. This ensures that the linker does not discard the resource's object file, and its initializer is called automatically. Change-Id: I70de439f964dc7257a2255683eda4d434fa451d0 Reviewed-by: Alexandru Croitor --- src/corelib/doc/src/resource-system.qdoc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/doc/src/resource-system.qdoc b/src/corelib/doc/src/resource-system.qdoc index 2ce38addc0..9b80c31b00 100644 --- a/src/corelib/doc/src/resource-system.qdoc +++ b/src/corelib/doc/src/resource-system.qdoc @@ -293,6 +293,10 @@ any longer), you can force removal of your resources by calling \l Q_CLEANUP_RESOURCE() with the same base name as above. - Note: The use of \l Q_INIT_RESOURCE() and \l Q_CLEANUP_RESOURCE() is - not necessary when the resource is built as part of the application. + \note The use of \l Q_INIT_RESOURCE() and \l Q_CLEANUP_RESOURCE() is + not necessary in the following cases: + \list + \li When the resource is built as part of the application. + \li When the resource is built with CMake as part of a static library. + \endlist */ -- cgit v1.2.3