summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cmake/QtPrecompiledHeadersHelpers.cmake12
-rw-r--r--src/corelib/doc/src/cmake/cmake-configure-variables.qdoc4
2 files changed, 16 insertions, 0 deletions
diff --git a/cmake/QtPrecompiledHeadersHelpers.cmake b/cmake/QtPrecompiledHeadersHelpers.cmake
index b47e4e74e33..7fe94664da3 100644
--- a/cmake/QtPrecompiledHeadersHelpers.cmake
+++ b/cmake/QtPrecompiledHeadersHelpers.cmake
@@ -14,6 +14,18 @@ function(qt_update_precompiled_header_with_library target library)
get_target_property(target_type "${library}" TYPE)
if(target_type STREQUAL "INTERFACE_LIBRARY")
+ # If target links against QtFooPrivate then QtFoo is transitively pulled
+ # in. We assume that headers from QtFoo will be used and add this
+ # library to the target's precompiled headers too.
+ get_target_property(is_private_module "${library}" _qt_is_private_module)
+ if(is_private_module)
+ get_target_property(public_module_target "${library}" _qt_public_module_target_name)
+ qt_update_precompiled_header_with_library("${target}"
+ "${QT_CMAKE_EXPORT_NAMESPACE}::${public_module_target}"
+ )
+ endif()
+
+ # Don't handle interface libraries any further.
return()
endif()
diff --git a/src/corelib/doc/src/cmake/cmake-configure-variables.qdoc b/src/corelib/doc/src/cmake/cmake-configure-variables.qdoc
index 42cb3ecb42b..b8e5e038a33 100644
--- a/src/corelib/doc/src/cmake/cmake-configure-variables.qdoc
+++ b/src/corelib/doc/src/cmake/cmake-configure-variables.qdoc
@@ -142,6 +142,10 @@ effectively disables release package signing even in Release or RelWithDebInfo
builds. When not set, the default behavior is to use release package signing in
build types other than Debug.
+This variable is not supposed to be set in CMake project files. Rather set it
+when configuring your project on the command line or in the CMake settings of
+your IDE.
+
\sa {androiddeployqt}
*/