Files
UnrealEngineUWP/Engine/Source/Programs/UnrealBuildTool/System/ActionExecutor.cs
jonathan adamczewski 2f91a18571 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

#ROBOMERGE-AUTHOR: jonathan.adamczewski
#ROBOMERGE-SOURCE: CL 17546182 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v870-17433530)

[CL 17546186 by jonathan adamczewski in ue5-release-engine-test branch]
2021-09-16 19:35:07 -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);
}
}