summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-07-20 15:45:34 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-07-20 15:46:00 (GMT)
commit9a2f3d4b68cfbb9b07b894cfdc52404c49b5abb2 (patch)
tree15eb9c6eb746ff9832a2ead11f02bfbddefe8ea5
parent97db2e6a309a4e1e5a5856b9ae8c1308730824c0 (diff)
parent9cebdbec77ac59a1394c3a28da43a7bf0bd37fe9 (diff)
downloadCMake-9a2f3d4b68cfbb9b07b894cfdc52404c49b5abb2.zip
CMake-9a2f3d4b68cfbb9b07b894cfdc52404c49b5abb2.tar.gz
CMake-9a2f3d4b68cfbb9b07b894cfdc52404c49b5abb2.tar.bz2
Merge topic 'autogen-ui-header-depends' into release-3.21
9cebdbec77 AUTOUIC: Fix cyclic dependency between generated UI headers and timestamp Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6359
-rw-r--r--Source/cmQtAutoMocUic.cxx20
1 files changed, 14 insertions, 6 deletions
diff --git a/Source/cmQtAutoMocUic.cxx b/Source/cmQtAutoMocUic.cxx
index f5c195f..2753fd5 100644
--- a/Source/cmQtAutoMocUic.cxx
+++ b/Source/cmQtAutoMocUic.cxx
@@ -2248,12 +2248,20 @@ void cmQtAutoMocUicT::JobDepFilesMergeT::Process()
std::for_each(this->MocEval().SourceMappings.begin(),
this->MocEval().SourceMappings.end(), processMappingEntry);
- // Remove SKIP_AUTOMOC files
- dependencies.erase(std::remove_if(dependencies.begin(), dependencies.end(),
- [this](const std::string& dep) {
- return this->MocConst().skipped(dep);
- }),
- dependencies.end());
+ // Remove SKIP_AUTOMOC files.
+ // Also remove AUTOUIC header files to avoid cyclic dependency.
+ dependencies.erase(
+ std::remove_if(dependencies.begin(), dependencies.end(),
+ [this](const std::string& dep) {
+ return this->MocConst().skipped(dep) ||
+ std::any_of(
+ this->UicEval().Includes.begin(),
+ this->UicEval().Includes.end(),
+ [&dep](MappingMapT::value_type const& mapping) {
+ return dep == mapping.second->OutputFile;
+ });
+ }),
+ dependencies.end());
// Remove duplicates to make the depfile smaller
std::sort(dependencies.begin(), dependencies.end());