diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-08-26 15:42:52 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-08-31 17:07:23 (GMT) |
commit | 6b20bbd2dd78747cb951d32c12b63c9605971b32 (patch) | |
tree | d45c56f99071d70c0833239587ce0fa7c7c9a52e /Source/cmQtAutoMocUic.cxx | |
parent | 9fbd3df21e4059f97a683922635b4b70c8465b3f (diff) | |
download | CMake-6b20bbd2dd78747cb951d32c12b63c9605971b32.zip CMake-6b20bbd2dd78747cb951d32c12b63c9605971b32.tar.gz CMake-6b20bbd2dd78747cb951d32c12b63c9605971b32.tar.bz2 |
AutoMoc: Restore support for re-running after project file changes
For Qt >= 5.15.0 and Ninja generators AutoMoc creates a depfile to let
Ninja decide when to run AutoMoc. This was introduced by commit aebfbcaa46
(AutoGen: Use depfiles for the XXX_autogen ninja targets, 2020-01-14,
v3.17.0-rc1~58^2).
However, AutoMoc was not triggered after adding a new moc-able file to
the project. This patch adds the project file (and potentially included
files) to the dependencies in the depfile.
Now, a re-run of AutoMoc is triggered if the project file changes.
Fixes: #21127
Diffstat (limited to 'Source/cmQtAutoMocUic.cxx')
-rw-r--r-- | Source/cmQtAutoMocUic.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/cmQtAutoMocUic.cxx b/Source/cmQtAutoMocUic.cxx index f159a3d..49eb018 100644 --- a/Source/cmQtAutoMocUic.cxx +++ b/Source/cmQtAutoMocUic.cxx @@ -184,6 +184,7 @@ public: std::string DepFile; std::string DepFileRuleName; std::vector<std::string> HeaderExtensions; + std::vector<std::string> ListFiles; }; /** Shared common variables. */ @@ -2176,7 +2177,7 @@ void cmQtAutoMocUicT::JobDepFilesMergeT::Process() return dependenciesFromDepFile(f.c_str()); }; - std::vector<std::string> dependencies; + std::vector<std::string> dependencies = BaseConst().ListFiles; ParseCacheT& parseCache = BaseEval().ParseCache; auto processMappingEntry = [&](const MappingMapT::value_type& m) { auto cacheEntry = parseCache.GetOrInsert(m.first); @@ -2258,6 +2259,7 @@ bool cmQtAutoMocUicT::InitFromInfo(InfoT const& info) !info.GetString("DEP_FILE_RULE_NAME", BaseConst_.DepFileRuleName, false) || !info.GetStringConfig("SETTINGS_FILE", SettingsFile_, true) || + !info.GetArray("CMAKE_LIST_FILES", BaseConst_.ListFiles, true) || !info.GetArray("HEADER_EXTENSIONS", BaseConst_.HeaderExtensions, true) || !info.GetString("QT_MOC_EXECUTABLE", MocConst_.Executable, false) || !info.GetString("QT_UIC_EXECUTABLE", UicConst_.Executable, false)) { |