mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-17 07:11:52 +08:00
Autogen: Protected calls to cmSystemTools::CollapseCombinedPath
This commit is contained in:
@@ -146,13 +146,20 @@ void cmQtAutoGenerator::Logger::ErrorCommand(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string cmQtAutoGenerator::FileSystem::RealPath(
|
std::string cmQtAutoGenerator::FileSystem::GetRealPath(
|
||||||
std::string const& filename)
|
std::string const& filename)
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lock(Mutex_);
|
std::lock_guard<std::mutex> lock(Mutex_);
|
||||||
return cmSystemTools::GetRealPath(filename);
|
return cmSystemTools::GetRealPath(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string cmQtAutoGenerator::FileSystem::CollapseCombinedPath(
|
||||||
|
std::string const& dir, std::string const& file)
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(Mutex_);
|
||||||
|
return cmSystemTools::CollapseCombinedPath(dir, file);
|
||||||
|
}
|
||||||
|
|
||||||
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_);
|
||||||
|
@@ -68,8 +68,17 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// @brief Logger
|
||||||
Logger* Log() const { return Log_; }
|
Logger* Log() const { return Log_; }
|
||||||
std::string RealPath(std::string const& filename);
|
|
||||||
|
// -- Paths
|
||||||
|
/// @brief Wrapper for cmSystemTools::GetRealPath
|
||||||
|
std::string GetRealPath(std::string const& filename);
|
||||||
|
/// @brief Wrapper for cmSystemTools::CollapseCombinedPath
|
||||||
|
std::string CollapseCombinedPath(std::string const& dir,
|
||||||
|
std::string const& file);
|
||||||
|
|
||||||
|
// -- File access
|
||||||
bool FileExists(std::string const& filename);
|
bool FileExists(std::string const& filename);
|
||||||
bool FileIsOlderThan(std::string const& buildFile,
|
bool FileIsOlderThan(std::string const& buildFile,
|
||||||
std::string const& sourceFile,
|
std::string const& sourceFile,
|
||||||
@@ -92,6 +101,7 @@ public:
|
|||||||
bool FileRemove(std::string const& filename);
|
bool FileRemove(std::string const& filename);
|
||||||
bool Touch(std::string const& filename);
|
bool Touch(std::string const& filename);
|
||||||
|
|
||||||
|
// -- Directory access
|
||||||
bool MakeDirectory(std::string const& dirname);
|
bool MakeDirectory(std::string const& dirname);
|
||||||
/// @brief Error logging version
|
/// @brief Error logging version
|
||||||
bool MakeDirectory(GeneratorT genType, std::string const& dirname);
|
bool MakeDirectory(GeneratorT genType, std::string const& dirname);
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
std::string cmQtAutoGeneratorMocUic::BaseSettingsT::AbsoluteBuildPath(
|
std::string cmQtAutoGeneratorMocUic::BaseSettingsT::AbsoluteBuildPath(
|
||||||
std::string const& relativePath) const
|
std::string const& relativePath) const
|
||||||
{
|
{
|
||||||
return cmSystemTools::CollapseCombinedPath(AutogenBuildDir, relativePath);
|
return FileSys->CollapseCombinedPath(AutogenBuildDir, relativePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -106,7 +106,7 @@ std::string cmQtAutoGeneratorMocUic::MocSettingsT::FindIncludedFile(
|
|||||||
std::string testPath = sourcePath;
|
std::string testPath = sourcePath;
|
||||||
testPath += includeString;
|
testPath += includeString;
|
||||||
if (FileSys->FileExists(testPath)) {
|
if (FileSys->FileExists(testPath)) {
|
||||||
return FileSys->RealPath(testPath);
|
return FileSys->GetRealPath(testPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Search in include directories
|
// Search in include directories
|
||||||
@@ -115,7 +115,7 @@ std::string cmQtAutoGeneratorMocUic::MocSettingsT::FindIncludedFile(
|
|||||||
fullPath.push_back('/');
|
fullPath.push_back('/');
|
||||||
fullPath += includeString;
|
fullPath += includeString;
|
||||||
if (FileSys->FileExists(fullPath)) {
|
if (FileSys->FileExists(fullPath)) {
|
||||||
return FileSys->RealPath(fullPath);
|
return FileSys->GetRealPath(fullPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Return empty string
|
// Return empty string
|
||||||
@@ -487,7 +487,7 @@ std::string cmQtAutoGeneratorMocUic::JobParseT::MocFindIncludedHeader(
|
|||||||
}
|
}
|
||||||
// Sanitize
|
// Sanitize
|
||||||
if (!header.empty()) {
|
if (!header.empty()) {
|
||||||
header = wrk.FileSys().RealPath(header);
|
header = wrk.FileSys().GetRealPath(header);
|
||||||
}
|
}
|
||||||
return header;
|
return header;
|
||||||
}
|
}
|
||||||
@@ -569,7 +569,7 @@ std::string cmQtAutoGeneratorMocUic::JobParseT::UicFindIncludedFile(
|
|||||||
// Search for the .ui file!
|
// Search for the .ui file!
|
||||||
for (std::string const& testFile : testFiles) {
|
for (std::string const& testFile : testFiles) {
|
||||||
if (wrk.FileSys().FileExists(testFile)) {
|
if (wrk.FileSys().FileExists(testFile)) {
|
||||||
res = wrk.FileSys().RealPath(testFile);
|
res = wrk.FileSys().GetRealPath(testFile);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user