logic: Implemented usage of PCH for indexing EmptyCxx Source Groups
* further change: initialize all llvm targets before indexing * further change: remove configurable dependencies directory from gradle and maven sourcegroups
This commit is contained in:
@@ -66,6 +66,45 @@ std::vector<FilePath> utility::getTopLevelPaths(const std::set<FilePath>& paths)
|
||||
return topLevelPaths;
|
||||
}
|
||||
|
||||
FilePath utility::getExpandedPath(const FilePath& path)
|
||||
{
|
||||
std::vector<FilePath> paths = path.expandEnvironmentVariables();
|
||||
if (!paths.empty())
|
||||
{
|
||||
if (paths.size() > 1)
|
||||
{
|
||||
LOG_WARNING(
|
||||
L"Environment variable in path \"" + path.wstr() + L"\" has been expanded to " + std::to_wstring(paths.size()) +
|
||||
L"paths, but only \"" + paths.front().wstr() + L"\" will be used."
|
||||
);
|
||||
}
|
||||
return paths.front();
|
||||
}
|
||||
return FilePath();
|
||||
}
|
||||
|
||||
std::vector<FilePath> utility::getExpandedPaths(const std::vector<FilePath>& paths)
|
||||
{
|
||||
std::vector<FilePath> expanedPaths;
|
||||
for (const FilePath& path : paths)
|
||||
{
|
||||
utility::append(expanedPaths, path.expandEnvironmentVariables());
|
||||
}
|
||||
return expanedPaths;
|
||||
}
|
||||
|
||||
FilePath utility::getExpandedAndAbsolutePath(const FilePath& path, const FilePath& baseDirectory)
|
||||
{
|
||||
FilePath p = getExpandedPath(path);
|
||||
|
||||
if (p.empty() || p.isAbsolute())
|
||||
{
|
||||
return p;
|
||||
}
|
||||
|
||||
return baseDirectory.getConcatenated(p).makeCanonical();
|
||||
}
|
||||
|
||||
FilePath utility::getAsRelativeIfShorter(const FilePath& absolutePath, const FilePath& baseDirectory)
|
||||
{
|
||||
if (!baseDirectory.empty())
|
||||
|
||||
@@ -13,6 +13,9 @@ namespace utility
|
||||
std::vector<FilePath> getTopLevelPaths(const std::vector<FilePath>& paths);
|
||||
std::vector<FilePath> getTopLevelPaths(const std::set<FilePath>& paths);
|
||||
|
||||
FilePath getExpandedPath(const FilePath& path);
|
||||
std::vector<FilePath> getExpandedPaths(const std::vector<FilePath>& paths);
|
||||
FilePath getExpandedAndAbsolutePath(const FilePath& path, const FilePath& baseDirectory);
|
||||
FilePath getAsRelativeIfShorter(const FilePath& absolutePath, const FilePath& baseDirectory);
|
||||
std::vector<FilePath> getAsRelativeIfShorter(const std::vector<FilePath>& absolutePaths, const FilePath& baseDirectory);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user