I haven’t tested it for a while, but it seems they improved a lot of stuff in GenerateClangDatabase. Perhaps there was a bug that was always forcing full recompilation and -NoExecCodeGenActions
was a simple workaround.
Looking through the code, it was always meant to be incremental, so I’m not sure why it wasn’t working for me back in 5.4.2:
if (bExecCodeGenActions)
{
// Filter all the actions to execute
HashSet<FileItem> PrerequisiteItems = new HashSet<FileItem>(Makefile.Actions.SelectMany(x => x.ProducedItems).Where(x => x.HasExtension(".h") || x.HasExtension(".cpp") || x.HasExtension(".cc") || x.HasExtension(".c")));
List<LinkedAction> PrerequisiteActions = ActionGraph.GatherPrerequisiteActions(Actions, PrerequisiteItems);
Utils.ExecuteCustomBuildSteps(Makefile.PreBuildScripts, Logger);
// Execute code generation actions
if (PrerequisiteActions.Any())
{
Logger.LogInformation("Executing actions that produce source files...");
await ActionGraph.ExecuteActionsAsync(BuildConfiguration, PrerequisiteActions, new List<TargetDescriptor> { TargetDescriptor }, Logger);
}
}