Serialize C++ includes cache results

Almost half the build tool runtime is spent scanning includes in C++-files, now the results are cached and invalidated when files last write timestamp changes.
This commit is contained in:
2022-12-27 20:59:38 +02:00
parent 762f460e23
commit 5c9a27a6d6
2 changed files with 191 additions and 8 deletions

View File

@@ -5,6 +5,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using Flax.Build.Graph;
using Flax.Build.NativeCpp;
namespace Flax.Build
{
@@ -256,6 +257,11 @@ namespace Flax.Build
if (targets.Length == 0)
Log.Warning("No targets to build");
using (new ProfileEventScope("LoadIncludesCache"))
{
IncludesCache.LoadCache();
}
// Create task graph for building all targets
var graph = new TaskGraph(project.ProjectFolderPath);
foreach (var target in targets)
@@ -393,6 +399,11 @@ namespace Flax.Build
}
}
using (new ProfileEventScope("SaveIncludesCache"))
{
IncludesCache.SaveCache();
}
foreach (var target in targets)
{
target.PostBuild();