mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-16 05:26:58 +08:00
Autogen: Protected calls to cmQtAutoGen::SubDirPrefix
This commit is contained in:
@@ -190,6 +190,13 @@ std::string cmQtAutoGenerator::FileSystem::GetFilenameWithoutLastExtension(
|
||||
return cmSystemTools::GetFilenameWithoutLastExtension(filename);
|
||||
}
|
||||
|
||||
std::string cmQtAutoGenerator::FileSystem::SubDirPrefix(
|
||||
std::string const& filename)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(Mutex_);
|
||||
return cmQtAutoGen::SubDirPrefix(filename);
|
||||
}
|
||||
|
||||
bool cmQtAutoGenerator::FileSystem::FileExists(std::string const& filename)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(Mutex_);
|
||||
|
@@ -87,6 +87,8 @@ public:
|
||||
std::vector<std::string>::const_iterator last);
|
||||
/// @brief Wrapper for cmSystemTools::GetFilenameWithoutLastExtension
|
||||
std::string GetFilenameWithoutLastExtension(const std::string& filename);
|
||||
/// @brief Wrapper for cmQtAutoGen::SubDirPrefix
|
||||
std::string SubDirPrefix(std::string const& filename);
|
||||
|
||||
// -- File access
|
||||
bool FileExists(std::string const& filename);
|
||||
|
@@ -166,7 +166,7 @@ void cmQtAutoGeneratorMocUic::JobParseT::Process(WorkerT& wrk)
|
||||
MetaT meta;
|
||||
if (wrk.FileSys().FileRead(meta.Content, FileName, &error)) {
|
||||
if (!meta.Content.empty()) {
|
||||
meta.FileDir = SubDirPrefix(FileName);
|
||||
meta.FileDir = wrk.FileSys().SubDirPrefix(FileName);
|
||||
meta.FileBase =
|
||||
wrk.FileSys().GetFilenameWithoutLastExtension(FileName);
|
||||
|
||||
@@ -222,7 +222,7 @@ bool cmQtAutoGeneratorMocUic::JobParseT::ParseMocSource(WorkerT& wrk,
|
||||
cmsys::RegularExpressionMatch match;
|
||||
while (wrk.Moc().RegExpInclude.find(contentChars, match)) {
|
||||
std::string incString = match.match(2);
|
||||
std::string incDir(SubDirPrefix(incString));
|
||||
std::string incDir(wrk.FileSys().SubDirPrefix(incString));
|
||||
std::string incBase =
|
||||
wrk.FileSys().GetFilenameWithoutLastExtension(incString);
|
||||
if (cmHasLiteralPrefix(incBase, "moc_")) {
|
||||
@@ -538,7 +538,7 @@ std::string cmQtAutoGeneratorMocUic::JobParseT::UicFindIncludedFile(
|
||||
// Collect search paths list
|
||||
std::deque<std::string> testFiles;
|
||||
{
|
||||
std::string const searchPath = SubDirPrefix(includeString);
|
||||
std::string const searchPath = wrk.FileSys().SubDirPrefix(includeString);
|
||||
|
||||
std::string searchFileFull;
|
||||
if (!searchPath.empty()) {
|
||||
@@ -798,7 +798,7 @@ bool cmQtAutoGeneratorMocUic::JobMocT::UpdateRequired(WorkerT& wrk)
|
||||
}
|
||||
// Check dependency timestamps
|
||||
std::string error;
|
||||
std::string sourceDir = SubDirPrefix(SourceFile);
|
||||
std::string sourceDir = wrk.FileSys().SubDirPrefix(SourceFile);
|
||||
for (std::string const& depFileRel : Depends) {
|
||||
std::string depFileAbs =
|
||||
wrk.Moc().FindIncludedFile(sourceDir, depFileRel);
|
||||
@@ -1416,7 +1416,7 @@ bool cmQtAutoGeneratorMocUic::Init(cmMakefile* makefile)
|
||||
// Search for the default header file and a private header
|
||||
{
|
||||
std::array<std::string, 2> bases;
|
||||
bases[0] = SubDirPrefix(src);
|
||||
bases[0] = FileSys().SubDirPrefix(src);
|
||||
bases[0] += FileSys().GetFilenameWithoutLastExtension(src);
|
||||
bases[1] = bases[0];
|
||||
bases[1] += "_p";
|
||||
|
Reference in New Issue
Block a user