mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-15 20:46:37 +08:00
Autogen: Protected calls to cmFilePathChecksum
Closes #17861 Closes #17862
This commit is contained in:
@@ -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_);
|
||||
|
@@ -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_;
|
||||
};
|
||||
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user