summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2018-04-03 12:45:16 +0200
committerSebastian Holtermann <sebholt@xwmw.org>2018-04-03 17:20:30 +0200
commitccc38fa509301a135e68542f9965f3ea9f0547b7 (patch)
tree7c8f83fd67b8c012113f0f6977c63c5bbf56e6fc
parent719b24c87244ac612cfdc85da0e75140b87df673 (diff)
downloadcmake-ccc38fa509301a135e68542f9965f3ea9f0547b7.tar.gz
Autogen: Protected calls to cmFilePathChecksum
Closes #17861 Closes #17862
-rw-r--r--Source/cmQtAutoGenerator.cxx16
-rw-r--r--Source/cmQtAutoGenerator.h9
-rw-r--r--Source/cmQtAutoGeneratorMocUic.cxx4
-rw-r--r--Source/cmQtAutoGeneratorMocUic.h2
4 files changed, 27 insertions, 4 deletions
diff --git a/Source/cmQtAutoGenerator.cxx b/Source/cmQtAutoGenerator.cxx
index b5e13014ac..f4444e387c 100644
--- a/Source/cmQtAutoGenerator.cxx
+++ b/Source/cmQtAutoGenerator.cxx
@@ -197,6 +197,22 @@ std::string cmQtAutoGenerator::FileSystem::SubDirPrefix(
return cmQtAutoGen::SubDirPrefix(filename);
}
+void cmQtAutoGenerator::FileSystem::setupFilePathChecksum(
+ std::string const& currentSrcDir, std::string const& currentBinDir,
+ std::string const& projectSrcDir, std::string const& projectBinDir)
+{
+ std::lock_guard<std::mutex> lock(Mutex_);
+ FilePathChecksum_.setupParentDirs(currentSrcDir, currentBinDir,
+ projectSrcDir, projectBinDir);
+}
+
+std::string cmQtAutoGenerator::FileSystem::GetFilePathChecksum(
+ std::string const& filename)
+{
+ std::lock_guard<std::mutex> lock(Mutex_);
+ return FilePathChecksum_.getPart(filename);
+}
+
bool cmQtAutoGenerator::FileSystem::FileExists(std::string const& filename)
{
std::lock_guard<std::mutex> lock(Mutex_);
diff --git a/Source/cmQtAutoGenerator.h b/Source/cmQtAutoGenerator.h
index b3a53bcb57..0995b46378 100644
--- a/Source/cmQtAutoGenerator.h
+++ b/Source/cmQtAutoGenerator.h
@@ -5,6 +5,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
+#include "cmFilePathChecksum.h"
#include "cmQtAutoGen.h"
#include "cmUVHandlePtr.h"
#include "cmUVSignalHackRAII.h" // IWYU pragma: keep
@@ -89,6 +90,13 @@ public:
std::string GetFilenameWithoutLastExtension(const std::string& filename);
/// @brief Wrapper for cmQtAutoGen::SubDirPrefix
std::string SubDirPrefix(std::string const& filename);
+ /// @brief Wrapper for cmFilePathChecksum::setupParentDirs
+ void setupFilePathChecksum(std::string const& currentSrcDir,
+ std::string const& currentBinDir,
+ std::string const& projectSrcDir,
+ std::string const& projectBinDir);
+ /// @brief Wrapper for cmFilePathChecksum::getPart
+ std::string GetFilePathChecksum(std::string const& filename);
// -- File access
bool FileExists(std::string const& filename);
@@ -124,6 +132,7 @@ public:
private:
std::mutex Mutex_;
+ cmFilePathChecksum FilePathChecksum_;
Logger* Log_;
};
diff --git a/Source/cmQtAutoGeneratorMocUic.cxx b/Source/cmQtAutoGeneratorMocUic.cxx
index c9dec10b2a..543bdf6dbe 100644
--- a/Source/cmQtAutoGeneratorMocUic.cxx
+++ b/Source/cmQtAutoGeneratorMocUic.cxx
@@ -676,7 +676,7 @@ void cmQtAutoGeneratorMocUic::JobMocT::Process(WorkerT& wrk)
BuildFile += '/';
BuildFile += IncludeString;
} else {
- std::string rel = wrk.Base().FilePathChecksum.getPart(SourceFile);
+ std::string rel = wrk.FileSys().GetFilePathChecksum(SourceFile);
rel += "/moc_";
rel += wrk.FileSys().GetFilenameWithoutLastExtension(SourceFile);
rel += ".cpp";
@@ -1444,7 +1444,7 @@ bool cmQtAutoGeneratorMocUic::Init(cmMakefile* makefile)
// ------------------------
// Init file path checksum generator
- Base_.FilePathChecksum.setupParentDirs(
+ FileSys().setupFilePathChecksum(
Base().CurrentSourceDir, Base().CurrentBinaryDir, Base().ProjectSourceDir,
Base().ProjectBinaryDir);
diff --git a/Source/cmQtAutoGeneratorMocUic.h b/Source/cmQtAutoGeneratorMocUic.h
index 696d5bdb2c..2226954111 100644
--- a/Source/cmQtAutoGeneratorMocUic.h
+++ b/Source/cmQtAutoGeneratorMocUic.h
@@ -5,7 +5,6 @@
#include "cmConfigure.h" // IWYU pragma: keep
-#include "cmFilePathChecksum.h"
#include "cmQtAutoGen.h"
#include "cmQtAutoGenerator.h"
#include "cmUVHandlePtr.h"
@@ -95,7 +94,6 @@ public:
std::string AutogenBuildDir;
std::string AutogenIncludeDir;
// - Files
- cmFilePathChecksum FilePathChecksum;
std::vector<std::string> HeaderExtensions;
// - File system
FileSystem* FileSys;