From 9fade925e36651c3d746a71ec312535f6922035a Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 16 May 2019 09:46:29 +0200 Subject: [PATCH] Stop trying to create config forwarding headers for NO_MODULE targets The GlobalConfig target is not an actual module, so there's no point in trying to create forwarding headers for GlobalConfig's qconfig.h within qt_feature_module_end. qconfig.h's forwarding header will be created implicitly while processing QtCore target's SYNCQT.INJECTIONS value, which is read from the headers.pri file generated by syncqt. This also fixes trying to create forwarding headers when processing the sqldrivers project. Amends 02a015375a639a4d27d19bbf435f20b725696768. Change-Id: Ifd70d8c3ebf881ffdcf90db8d5d3b23309bc8fed Reviewed-by: Simon Hausmann Reviewed-by: Tobias Hunger --- cmake/QtBaseGlobalTargets.cmake | 2 +- cmake/QtFeature.cmake | 20 ++++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index 7bb4795d353..7bb55ba3d9c 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -63,7 +63,7 @@ target_include_directories(GlobalConfig INTERFACE $ $ ) -qt_feature_module_begin(LIBRARY Core +qt_feature_module_begin(NO_MODULE PUBLIC_FILE src/corelib/global/qconfig.h PRIVATE_FILE src/corelib/global/qconfig_p.h ) diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index 50c672d08cb..6c6c2eedbba 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -397,15 +397,19 @@ function(qt_feature_module_end) # Extra header injections which have to have forwarding headers created by # qt_install_injections. - set(injections "") - qt_compute_injection_forwarding_header("${__QtFeature_library}" - SOURCE "${__QtFeature_public_file}" - OUT_VAR injections) - qt_compute_injection_forwarding_header("${__QtFeature_library}" - SOURCE "${__QtFeature_private_file}" PRIVATE - OUT_VAR injections) + # Skip creating forwarding headers if qt_feature_module_begin was called with NO_MODULE, aka + # there is no include/ so there's no place to put the forwarding headers. + if(__QtFeature_library) + set(injections "") + qt_compute_injection_forwarding_header("${__QtFeature_library}" + SOURCE "${__QtFeature_public_file}" + OUT_VAR injections) + qt_compute_injection_forwarding_header("${__QtFeature_library}" + SOURCE "${__QtFeature_private_file}" PRIVATE + OUT_VAR injections) - set(${arg_OUT_VAR_PREFIX}extra_library_injections ${injections} PARENT_SCOPE) + set(${arg_OUT_VAR_PREFIX}extra_library_injections ${injections} PARENT_SCOPE) + endif() if (NOT ("${target}" STREQUAL "NO_MODULE")) get_target_property(targetType "${target}" TYPE)