Files
UnrealEngineUWP/Engine/Source/Programs/UnrealBuildTool/System/ActionExecutor.cs
jonathan adamczewski 5e55080b19 UnrealBuildTool: allow MemoryPerAction to be set per-target
Can be used to reduce the number of build actions that will be run in parallel by ParallelExecutor or TaskExecutor.

Example use, in MyProject.Target.cs:

public class MyProjectTarget : TargetRules
{
	public MyProjectTarget(TargetInfo Target) : base(Target)
	{
		Type = TargetType.Game;
		DefaultBuildSettings = BuildSettingsVersion.V2;

		ExtraModuleNames.AddRange( new string[] { "MyProject" } );

		MemoryPerActionGB = 4;
	}
}

#jira none

[CL 17546182 by jonathan adamczewski in ue5-main branch]
2021-09-16 19:34:54 -04:00

35 lines
836 B
C#

// Copyright Epic Games, Inc. All Rights Reserved.
using System;
using System.Collections.Generic;
namespace UnrealBuildTool
{
abstract class ActionExecutor
{
public abstract string Name
{
get;
}
static protected double MemoryPerActionBytesOverride
{
get;
private set;
} = 0.0;
/// <summary>
/// Allow targets to override the expected amount of memory required for compiles, used to control the number
/// of parallel action processes.
/// </summary>
/// <param name="MemoryPerActionOverrideGB"></param>
public static void SetMemoryPerActionOverride(double MemoryPerActionOverrideGB)
{
MemoryPerActionBytesOverride = Math.Max(MemoryPerActionBytesOverride, MemoryPerActionOverrideGB * 1024 * 1024 * 1024);
}
public abstract bool ExecuteActions(List<LinkedAction> ActionsToExecute);
}
}