summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutoMocUic.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-04-16 15:35:40 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-04-16 15:35:47 (GMT)
commitd00ddb9761b1435c0e17c7a58ac314088635dd4f (patch)
tree58ae42b744fd321ec49da8e69ef033bbb27ee1a2 /Source/cmQtAutoMocUic.cxx
parente5a098968c3a25df75b82363515795e793a668ae (diff)
parent53d523f2e11839bcbbdc9288b4f71c764d0efd5c (diff)
downloadCMake-d00ddb9761b1435c0e17c7a58ac314088635dd4f.zip
CMake-d00ddb9761b1435c0e17c7a58ac314088635dd4f.tar.gz
CMake-d00ddb9761b1435c0e17c7a58ac314088635dd4f.tar.bz2
Merge topic 'depfile-reader-thread-safety'
53d523f2e1 autogen: fix race in depfile parsing Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6008
Diffstat (limited to 'Source/cmQtAutoMocUic.cxx')
-rw-r--r--Source/cmQtAutoMocUic.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/cmQtAutoMocUic.cxx b/Source/cmQtAutoMocUic.cxx
index c32c965..e2b1ae1 100644
--- a/Source/cmQtAutoMocUic.cxx
+++ b/Source/cmQtAutoMocUic.cxx
@@ -564,8 +564,7 @@ private:
// -- Generation
bool CreateDirectories();
// -- Support for depfiles
- static std::vector<std::string> dependenciesFromDepFile(
- const char* filePath);
+ std::vector<std::string> dependenciesFromDepFile(const char* filePath);
// -- Settings
BaseSettingsT BaseConst_;
@@ -2066,7 +2065,8 @@ void cmQtAutoMocUicT::JobCompileMocT::Process()
" does not exist.");
return;
}
- this->CacheEntry->Moc.Depends = dependenciesFromDepFile(depfile.c_str());
+ this->CacheEntry->Moc.Depends =
+ this->Gen()->dependenciesFromDepFile(depfile.c_str());
}
}
@@ -2223,12 +2223,12 @@ void cmQtAutoMocUicT::JobDepFilesMergeT::Process()
this->MessagePath(this->BaseConst().DepFile.c_str())));
}
auto processDepFile =
- [](const std::string& mocOutputFile) -> std::vector<std::string> {
+ [this](const std::string& mocOutputFile) -> std::vector<std::string> {
std::string f = mocOutputFile + ".d";
if (!cmSystemTools::FileExists(f)) {
return {};
}
- return dependenciesFromDepFile(f.c_str());
+ return this->Gen()->dependenciesFromDepFile(f.c_str());
};
std::vector<std::string> dependencies = this->initialDependencies();
@@ -2961,6 +2961,7 @@ bool cmQtAutoMocUicT::CreateDirectories()
std::vector<std::string> cmQtAutoMocUicT::dependenciesFromDepFile(
const char* filePath)
{
+ std::lock_guard<std::mutex> guard(this->CMakeLibMutex_);
auto const content = cmReadGccDepfile(filePath);
if (!content || content->empty()) {
return {};