mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-19 02:17:27 +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);
|
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)
|
bool cmQtAutoGenerator::FileSystem::FileExists(std::string const& filename)
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lock(Mutex_);
|
std::lock_guard<std::mutex> lock(Mutex_);
|
||||||
|
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
#include "cmConfigure.h" // IWYU pragma: keep
|
#include "cmConfigure.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "cmFilePathChecksum.h"
|
||||||
#include "cmQtAutoGen.h"
|
#include "cmQtAutoGen.h"
|
||||||
#include "cmUVHandlePtr.h"
|
#include "cmUVHandlePtr.h"
|
||||||
#include "cmUVSignalHackRAII.h" // IWYU pragma: keep
|
#include "cmUVSignalHackRAII.h" // IWYU pragma: keep
|
||||||
@@ -89,6 +90,13 @@ public:
|
|||||||
std::string GetFilenameWithoutLastExtension(const std::string& filename);
|
std::string GetFilenameWithoutLastExtension(const std::string& filename);
|
||||||
/// @brief Wrapper for cmQtAutoGen::SubDirPrefix
|
/// @brief Wrapper for cmQtAutoGen::SubDirPrefix
|
||||||
std::string SubDirPrefix(std::string const& filename);
|
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
|
// -- File access
|
||||||
bool FileExists(std::string const& filename);
|
bool FileExists(std::string const& filename);
|
||||||
@@ -124,6 +132,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
std::mutex Mutex_;
|
std::mutex Mutex_;
|
||||||
|
cmFilePathChecksum FilePathChecksum_;
|
||||||
Logger* Log_;
|
Logger* Log_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -676,7 +676,7 @@ void cmQtAutoGeneratorMocUic::JobMocT::Process(WorkerT& wrk)
|
|||||||
BuildFile += '/';
|
BuildFile += '/';
|
||||||
BuildFile += IncludeString;
|
BuildFile += IncludeString;
|
||||||
} else {
|
} else {
|
||||||
std::string rel = wrk.Base().FilePathChecksum.getPart(SourceFile);
|
std::string rel = wrk.FileSys().GetFilePathChecksum(SourceFile);
|
||||||
rel += "/moc_";
|
rel += "/moc_";
|
||||||
rel += wrk.FileSys().GetFilenameWithoutLastExtension(SourceFile);
|
rel += wrk.FileSys().GetFilenameWithoutLastExtension(SourceFile);
|
||||||
rel += ".cpp";
|
rel += ".cpp";
|
||||||
@@ -1444,7 +1444,7 @@ bool cmQtAutoGeneratorMocUic::Init(cmMakefile* makefile)
|
|||||||
// ------------------------
|
// ------------------------
|
||||||
|
|
||||||
// Init file path checksum generator
|
// Init file path checksum generator
|
||||||
Base_.FilePathChecksum.setupParentDirs(
|
FileSys().setupFilePathChecksum(
|
||||||
Base().CurrentSourceDir, Base().CurrentBinaryDir, Base().ProjectSourceDir,
|
Base().CurrentSourceDir, Base().CurrentBinaryDir, Base().ProjectSourceDir,
|
||||||
Base().ProjectBinaryDir);
|
Base().ProjectBinaryDir);
|
||||||
|
|
||||||
|
@@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
#include "cmConfigure.h" // IWYU pragma: keep
|
#include "cmConfigure.h" // IWYU pragma: keep
|
||||||
|
|
||||||
#include "cmFilePathChecksum.h"
|
|
||||||
#include "cmQtAutoGen.h"
|
#include "cmQtAutoGen.h"
|
||||||
#include "cmQtAutoGenerator.h"
|
#include "cmQtAutoGenerator.h"
|
||||||
#include "cmUVHandlePtr.h"
|
#include "cmUVHandlePtr.h"
|
||||||
@@ -95,7 +94,6 @@ public:
|
|||||||
std::string AutogenBuildDir;
|
std::string AutogenBuildDir;
|
||||||
std::string AutogenIncludeDir;
|
std::string AutogenIncludeDir;
|
||||||
// - Files
|
// - Files
|
||||||
cmFilePathChecksum FilePathChecksum;
|
|
||||||
std::vector<std::string> HeaderExtensions;
|
std::vector<std::string> HeaderExtensions;
|
||||||
// - File system
|
// - File system
|
||||||
FileSystem* FileSys;
|
FileSystem* FileSys;
|
||||||
|
Reference in New Issue
Block a user