2019-12-26 14:45:42 -05:00
// Copyright Epic Games, Inc. All Rights Reserved.
2014-03-14 14:13:41 -04:00
2018-08-14 18:32:34 -04:00
using System ;
using System.Collections.Generic ;
2014-03-14 14:13:41 -04:00
namespace UnrealBuildTool.Rules
{
public class Projects : ModuleRules
{
2017-01-30 16:52:08 -05:00
public Projects ( ReadOnlyTargetRules Target ) : base ( Target )
2014-03-14 14:13:41 -04:00
{
PublicDependencyModuleNames . AddRange (
new string [ ]
{
"Core" ,
2014-09-25 18:03:04 -04:00
"Json" ,
2014-03-14 14:13:41 -04:00
}
) ;
PrivateIncludePaths . AddRange (
new string [ ]
{
"Runtime/Projects/Private" ,
}
) ;
2017-07-21 12:42:36 -04:00
2020-03-18 07:04:23 -04:00
// 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.
2021-02-18 18:13:28 -04:00
if ( ( Target . Type = = TargetType . Editor ) & & ( Target . BuildEnvironment = = TargetBuildEnvironment . Shared ) & & ( Target . LinkType ! = TargetLinkType . Monolithic ) )
2018-08-14 18:32:34 -04:00
{
2020-03-18 07:04:23 -04:00
PublicDefinitions . Add ( "READ_TARGET_ENABLED_PLUGINS_FROM_RECEIPT=1" ) ;
2018-08-14 18:32:34 -04:00
2020-03-18 07:04:23 -04:00
// 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 ) ) ) ;
2018-08-14 18:32:34 -04:00
}
2017-07-21 12:42:36 -04:00
if ( Target . bIncludePluginsForTargetPlatforms )
{
2017-12-12 18:32:45 -05:00
PublicDefinitions . Add ( "LOAD_PLUGINS_FOR_TARGET_PLATFORMS=1" ) ;
2017-07-21 12:42:36 -04:00
}
else
{
2017-12-12 18:32:45 -05:00
PublicDefinitions . Add ( "LOAD_PLUGINS_FOR_TARGET_PLATFORMS=0" ) ;
2017-07-21 12:42:36 -04:00
}
2014-03-14 14:13:41 -04:00
}
}
}