summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-01-07 13:25:22 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-01-07 13:25:29 (GMT)
commit520df2880b7f172371de5a6adc6d6ada0e45ac8d (patch)
tree28e314faca285d0b7c57748669f075abd9dfe4d0 /Source
parentabee7c60af720bcf8ed34809d3830f85b0cd6f47 (diff)
parent8cb8dd6da5552d81983c93b0cc69facac6c7b236 (diff)
downloadCMake-520df2880b7f172371de5a6adc6d6ada0e45ac8d.zip
CMake-520df2880b7f172371de5a6adc6d6ada0e45ac8d.tar.gz
CMake-520df2880b7f172371de5a6adc6d6ada0e45ac8d.tar.bz2
Merge topic 'fix-21620'
8cb8dd6da5 AutoMoc: Re-run after adding Q_OBJECT macro fefba42e37 Add a failing test case for #21620 2999c40dd9 Extend QtAutogen/RerunMoc f623664e87 Do not use try_compile in RerunMocBasic test Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5642
Diffstat (limited to 'Source')
-rw-r--r--Source/cmQtAutoMocUic.cxx26
1 files changed, 25 insertions, 1 deletions
diff --git a/Source/cmQtAutoMocUic.cxx b/Source/cmQtAutoMocUic.cxx
index 7365fdb..3556051 100644
--- a/Source/cmQtAutoMocUic.cxx
+++ b/Source/cmQtAutoMocUic.cxx
@@ -522,6 +522,7 @@ public:
class JobDepFilesMergeT : public JobFenceT
{
private:
+ std::vector<std::string> initialDependencies() const;
void Process() override;
};
@@ -2198,6 +2199,29 @@ std::string escapeDependencyPath(cm::string_view path)
return escapedPath;
}
+/*
+ * Return the initial dependencies of the merged depfile.
+ * Those are dependencies from the project files, not from moc runs.
+ */
+std::vector<std::string>
+cmQtAutoMocUicT::JobDepFilesMergeT::initialDependencies() const
+{
+ std::vector<std::string> dependencies;
+ dependencies.reserve(this->BaseConst().ListFiles.size() +
+ this->BaseEval().Headers.size() +
+ this->BaseEval().Sources.size());
+ cm::append(dependencies, this->BaseConst().ListFiles);
+ auto append_file_path =
+ [&dependencies](const SourceFileMapT::value_type& p) {
+ dependencies.push_back(p.first);
+ };
+ std::for_each(this->BaseEval().Headers.begin(),
+ this->BaseEval().Headers.end(), append_file_path);
+ std::for_each(this->BaseEval().Sources.begin(),
+ this->BaseEval().Sources.end(), append_file_path);
+ return dependencies;
+}
+
void cmQtAutoMocUicT::JobDepFilesMergeT::Process()
{
if (this->Log().Verbose()) {
@@ -2215,7 +2239,7 @@ void cmQtAutoMocUicT::JobDepFilesMergeT::Process()
return dependenciesFromDepFile(f.c_str());
};
- std::vector<std::string> dependencies = this->BaseConst().ListFiles;
+ std::vector<std::string> dependencies = this->initialDependencies();
ParseCacheT& parseCache = this->BaseEval().ParseCache;
auto processMappingEntry = [&](const MappingMapT::value_type& m) {
auto cacheEntry = parseCache.GetOrInsert(m.first);