summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutoMocUic.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-08-19 16:22:47 (GMT)
committerBrad King <brad.king@kitware.com>2021-08-19 16:23:16 (GMT)
commitd2a6e160aa74479fc623918b084423739a9b80c7 (patch)
tree2f70830294927051da466660fb28484d25f205f0 /Source/cmQtAutoMocUic.cxx
parent30dd9b33a048ec76fd48665f3793cf282cd75f12 (diff)
downloadCMake-d2a6e160aa74479fc623918b084423739a9b80c7.zip
CMake-d2a6e160aa74479fc623918b084423739a9b80c7.tar.gz
CMake-d2a6e160aa74479fc623918b084423739a9b80c7.tar.bz2
AUTOUIC: Revert "Fix generating of dependency rules for UI header files"
Revert commit e5ec0e52f4 (AUTOUIC: Fix generating of dependency rules for UI header files, 2021-07-22, v3.21.1~8^2) because it caused regressions. For example, changing one C++ source can now cause many others to rebuild. Revert the change pending further investigation. Fixes: #22531 Issue: #16776
Diffstat (limited to 'Source/cmQtAutoMocUic.cxx')
-rw-r--r--Source/cmQtAutoMocUic.cxx20
1 files changed, 16 insertions, 4 deletions
diff --git a/Source/cmQtAutoMocUic.cxx b/Source/cmQtAutoMocUic.cxx
index 86d54f9..2753fd5 100644
--- a/Source/cmQtAutoMocUic.cxx
+++ b/Source/cmQtAutoMocUic.cxx
@@ -30,7 +30,6 @@
#include "cmGeneratedFileStream.h"
#include "cmQtAutoGen.h"
#include "cmQtAutoGenerator.h"
-#include "cmQtAutoUicHelpers.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmWorkerPool.h"
@@ -282,7 +281,7 @@ public:
std::vector<std::string> Options;
std::unordered_map<std::string, UiFile> UiFiles;
std::vector<std::string> SearchPaths;
- cmQtAutoUicHelpers AutoUicHelpers;
+ cmsys::RegularExpression RegExpInclude;
};
/** Uic shared variables. */
@@ -762,7 +761,11 @@ std::string cmQtAutoMocUicT::MocSettingsT::MacrosString() const
return res;
}
-cmQtAutoMocUicT::UicSettingsT::UicSettingsT() = default;
+cmQtAutoMocUicT::UicSettingsT::UicSettingsT()
+{
+ this->RegExpInclude.compile("(^|\n)[ \t]*#[ \t]*include[ \t]+"
+ "[\"<](([^ \">]+/)?ui_[^ \">/]+\\.h)[\">]");
+}
cmQtAutoMocUicT::UicSettingsT::~UicSettingsT() = default;
@@ -1053,7 +1056,16 @@ void cmQtAutoMocUicT::JobParseT::UicIncludes()
}
std::set<std::string> includes;
- this->UicConst().AutoUicHelpers.CollectUicIncludes(includes, this->Content);
+ {
+ const char* contentChars = this->Content.c_str();
+ cmsys::RegularExpression const& regExp = this->UicConst().RegExpInclude;
+ cmsys::RegularExpressionMatch match;
+ while (regExp.find(contentChars, match)) {
+ includes.emplace(match.match(2));
+ // Forward content pointer
+ contentChars += match.end();
+ }
+ }
this->CreateKeys(this->FileHandle->ParseData->Uic.Include, includes,
UiUnderscoreLength);
}