Skip to content

Commit

Permalink
Prefer local packages, remove Library folder from search paths
Browse files Browse the repository at this point in the history
  • Loading branch information
krasnotsvetov committed Jul 28, 2020
1 parent 4386570 commit 064781b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public CppInclusionContextResult CreateInclusionContextResult(CppGlobalSymbolCac
{
properties.IncludePaths.Add(cgIncludeFolder);
properties.IncludePaths.Add(cache.Solution.SolutionDirectory);
properties.IncludePaths.Add(cache.Solution.SolutionDirectory.Combine("Library"));
}

var shaderCache = cache.Solution.GetComponent<InjectedHlslFileLocationTracker>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ public bool IsApplicable(CppInclusionContext context, string path)

public string TransformPath(CppInclusionContext context, string path)
{
var solutionFolder = mySolution.SolutionDirectory;
if (solutionFolder.Combine(path).Exists != FileSystemPath.Existence.Missing)
return path;

var pos = path.IndexOf('/') + 1;
if (pos == -1)
return path;
Expand All @@ -53,7 +57,7 @@ public string TransformPath(CppInclusionContext context, string path)

var localPackagePath = FileSystemPath.Parse("Packages")
.Combine(packageName + "@" + suffix + path.Substring(endPos));
if (mySolution.SolutionDirectory.Combine(localPackagePath).Exists == FileSystemPath.Existence.File)
if (solutionFolder.Combine(localPackagePath).Exists == FileSystemPath.Existence.File)
return localPackagePath.FullPath;

var cachedPackagePath = FileSystemPath.Parse("Library").Combine("PackageCache")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public CppCompilationProperties GetCompilationProperties(IProject project, IProj

properties.PredefinedMacros.Add(CppPPDefineSymbol.ParsePredefinedMacro("SHADER_API_D3D11"));
properties.IncludePaths.Add(globalCache.Solution.SolutionDirectory);
properties.IncludePaths.Add(globalCache.Solution.SolutionDirectory.Combine("Library"));

return properties;
}
Expand Down

0 comments on commit 064781b

Please sign in to comment.