Files
UnrealEngineUWP/Engine/Source/Runtime/Projects/Projects.Build.cs
bob tellez 7dff64fb44 #UE4 Write the target-enabled/disabled plugins lists to the target receipt instead of compiling it into the executable in non-monolitic editor builds. This allows them to be used in shared build environments
#rb Ben.Marsh


#ROBOMERGE-SOURCE: CL 12233987 via CL 12241649
#ROBOMERGE-BOT: (v667-12241502)

[CL 12242840 by bob tellez in Main branch]
2020-03-18 07:04:23 -04:00

70 lines
1.9 KiB
C#

// Copyright Epic Games, Inc. All Rights Reserved.
using System;
using System.Collections.Generic;
namespace UnrealBuildTool.Rules
{
public class Projects : ModuleRules
{
public Projects(ReadOnlyTargetRules Target) : base(Target)
{
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
"Json",
}
);
PrivateIncludePaths.AddRange(
new string[]
{
"Runtime/Projects/Private",
}
);
// Monolithic and non-editor builds compile in the enabled/disabled plugins. Non-monolithic editor builds save them in the plugin receipt to avoid invalidating the shared build environment.
if (Target.Type == TargetType.Editor && Target.LinkType != TargetLinkType.Monolithic)
{
PublicDefinitions.Add("READ_TARGET_ENABLED_PLUGINS_FROM_RECEIPT=1");
// Include DesktopPlatform to work with the target receipt which contains the enabled/disabled plugins
PrivateDependencyModuleNames.AddRange(
new string[]
{
"DesktopPlatform"
}
);
}
else
{
PublicDefinitions.Add("READ_TARGET_ENABLED_PLUGINS_FROM_RECEIPT=0");
List<string> EnabledPluginStrings = new List<string>();
foreach(string EnablePlugin in Target.EnablePlugins)
{
EnabledPluginStrings.Add(String.Format("TEXT(\"{0}\")", EnablePlugin));
}
PrivateDefinitions.Add(String.Format("UBT_TARGET_ENABLED_PLUGINS={0}", String.Join(", ", EnabledPluginStrings)));
List<string> DisabledPluginStrings = new List<string>();
foreach(string DisablePlugin in Target.DisablePlugins)
{
DisabledPluginStrings.Add(String.Format("TEXT(\"{0}\")", DisablePlugin));
}
PrivateDefinitions.Add(String.Format("UBT_TARGET_DISABLED_PLUGINS={0}", String.Join(", ", DisabledPluginStrings)));
}
if (Target.bIncludePluginsForTargetPlatforms)
{
PublicDefinitions.Add("LOAD_PLUGINS_FOR_TARGET_PLATFORMS=1");
}
else
{
PublicDefinitions.Add("LOAD_PLUGINS_FOR_TARGET_PLATFORMS=0");
}
}
}
}