using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace UnrealBuildTool
{
///
/// The type of target
///
[Serializable]
public enum TargetType
{
///
/// Cooked monolithic game executable (GameName.exe). Also used for a game-agnostic engine executable (UE4Game.exe or RocketGame.exe)
///
Game,
///
/// Uncooked modular editor executable and DLLs (UE4Editor.exe, UE4Editor*.dll, GameName*.dll)
///
Editor,
///
/// Cooked monolithic game client executable (GameNameClient.exe, but no server code)
///
Client,
///
/// Cooked monolithic game server executable (GameNameServer.exe, but no client code)
///
Server,
///
/// Program (standalone program, e.g. ShaderCompileWorker.exe, can be modular or monolithic depending on the program)
///
Program,
}
///
/// Specifies how to link all the modules in this target
///
[Serializable]
public enum TargetLinkType
{
///
/// Use the default link type based on the current target type
///
Default,
///
/// Link all modules into a single binary
///
Monolithic,
///
/// Link modules into individual dynamic libraries
///
Modular,
}
///
/// Specifies whether to share engine binaries and intermediates with other projects, or to create project-specific versions. By default,
/// editor builds always use the shared build environment (and engine binaries are written to Engine/Binaries/Platform), but monolithic builds
/// and programs do not (except in installed builds). Using the shared build environment prevents target-specific modifications to the build
/// environment.
///
[Serializable]
public enum TargetBuildEnvironment
{
///
/// Use the default build environment for this target type (and whether the engine is installed)
///
Default,
///
/// Engine binaries and intermediates are output to the engine folder. Target-specific modifications to the engine build environment will be ignored.
///
Shared,
///
/// Engine binaries and intermediates are specific to this target
///
Unique,
}
///
/// TargetRules is a data structure that contains the rules for defining a target (application/executable)
///
public abstract class TargetRules
{
///
/// Static class wrapping constants aliasing the global TargetType enum.
///
public static class TargetType
{
///
/// Alias for TargetType.Game
///
public const global::UnrealBuildTool.TargetType Game = global::UnrealBuildTool.TargetType.Game;
///
/// Alias for TargetType.Editor
///
public const global::UnrealBuildTool.TargetType Editor = global::UnrealBuildTool.TargetType.Editor;
///
/// Alias for TargetType.Client
///
public const global::UnrealBuildTool.TargetType Client = global::UnrealBuildTool.TargetType.Client;
///
/// Alias for TargetType.Server
///
public const global::UnrealBuildTool.TargetType Server = global::UnrealBuildTool.TargetType.Server;
///
/// Alias for TargetType.Program
///
public const global::UnrealBuildTool.TargetType Program = global::UnrealBuildTool.TargetType.Program;
}
///
/// Dummy class to maintain support for the SetupGlobalEnvironment() callback. We don't expose these classes directly any more.
///
public class LinkEnvironmentConfiguration
{
///
/// TargetRules instance to forward settings to.
///
TargetRules Inner;
///
/// Constructor.
///
/// The target rules object. Fields on this object are treated as aliases to fields on this rules object.
public LinkEnvironmentConfiguration(TargetRules Inner)
{
this.Inner = Inner;
}
///
/// Settings exposed from the TargetRules instance
///
#region Forwarded fields
#if !__MonoCS__
#pragma warning disable CS1591
#endif
public bool bHasExports
{
get { return Inner.bHasExports; }
set { Inner.bHasExports = value; }
}
public bool bIsBuildingConsoleApplication
{
get { return Inner.bIsBuildingConsoleApplication; }
set { Inner.bIsBuildingConsoleApplication = value; }
}
public bool bDisableSymbolCache
{
get { return Inner.bDisableSymbolCache; }
set { Inner.bDisableSymbolCache = value; }
}
#if !__MonoCS__
#pragma warning restore CS1591
#endif
#endregion
}
///
/// Dummy class to maintain support for the SetupGlobalEnvironment() callback. We don't expose these classes directly any more.
///
public class CPPEnvironmentConfiguration
{
///
/// TargetRules instance to forward settings to.
///
TargetRules Inner;
///
/// Constructor.
///
/// The target rules object. Fields on this object are treated as aliases to fields on this rules object.
public CPPEnvironmentConfiguration(TargetRules Inner)
{
this.Inner = Inner;
}
///
/// Settings exposed from the TargetRules instance
///
#region Forwarded fields
#if !__MonoCS__
#pragma warning disable CS1591
#endif
public List Definitions
{
get { return Inner.GlobalDefinitions; }
}
public bool bEnableOSX109Support
{
get { return Inner.bEnableOSX109Support; }
set { Inner.bEnableOSX109Support = value; }
}
#if !__MonoCS__
#pragma warning restore CS1591
#endif
#endregion
}
///
/// The name of this target.
///
public readonly string Name;
///
/// Platform that this target is being built for.
///
public readonly UnrealTargetPlatform Platform;
///
/// The configuration being built.
///
public readonly UnrealTargetConfiguration Configuration;
///
/// Architecture that the target is being built for (or an empty string for the default).
///
public readonly string Architecture;
///
/// Path to the project file for the project containing this target.
///
public readonly FileReference ProjectFile;
///
/// The type of target.
///
public global::UnrealBuildTool.TargetType Type = global::UnrealBuildTool.TargetType.Game;
///
/// Whether the target uses Steam.
///
public bool bUsesSteam;
///
/// Whether the target uses CEF3.
///
public bool bUsesCEF3;
///
/// Whether the project uses visual Slate UI (as opposed to the low level windowing/messaging, which is always available).
///
public bool bUsesSlate = true;
///
/// Forces linking against the static CRT. This is not fully supported across the engine due to the need for allocator implementations to be shared (for example), and TPS
/// libraries to be consistent with each other, but can be used for utility programs.
///
public bool bUseStaticCRT = false;
///
/// Enables the debug C++ runtime (CRT) for debug builds. By default we always use the release runtime, since the debug
/// version isn't particularly useful when debugging Unreal Engine projects, and linking against the debug CRT libraries forces
/// our third party library dependencies to also be compiled using the debug CRT (and often perform more slowly). Often
/// it can be inconvenient to require a separate copy of the debug versions of third party static libraries simply
/// so that you can debug your program's code.
///
[XmlConfigFile(Category = "BuildConfiguration")]
public bool bDebugBuildsActuallyUseDebugCRT = false;
///
/// Whether the output from this target can be publicly distributed, even if it has dependencies on modules that are in folders
/// with special restrictions (eg. CarefullyRedist, NotForLicensees, NoRedist).
///
public bool bOutputPubliclyDistributable = false;
///
/// Specifies the configuration whose binaries do not require a "-Platform-Configuration" suffix.
///
public UnrealTargetConfiguration UndecoratedConfiguration = UnrealTargetConfiguration.Development;
///
/// Build all the plugins that we can find, even if they're not enabled. This is particularly useful for content-only projects,
/// where you're building the UE4Editor target but running it with a game that enables a plugin.
///
public bool bBuildAllPlugins = false;
///
/// A list of additional plugins which need to be included in this target. This allows referencing non-optional plugin modules
/// which cannot be disabled, and allows building against specific modules in program targets which do not fit the categories
/// in ModuleHostType.
///
public List AdditionalPlugins = new List();
///
/// Path to the set of pak signing keys to embed in the executable.
///
public string PakSigningKeysFile = "";
///
/// Allows a Program Target to specify it's own solution folder path.
///
public string SolutionDirectory = String.Empty;
///
/// Output the executable to the engine binaries folder.
///
public bool bOutputToEngineBinaries = false;
///
/// Whether this target should be compiled as a DLL. Requires LinkType to be set to TargetLinkType.Monolithic.
///
public bool bShouldCompileAsDLL = false;
///
/// Subfolder to place executables in, relative to the default location.
///
public string ExeBinariesSubFolder = String.Empty;
///
/// Allow target module to override UHT code generation version.
///
public EGeneratedCodeVersion GeneratedCodeVersion = EGeneratedCodeVersion.None;
///
/// Whether to include PhysX support.
///
public bool bCompilePhysX = true;
///
/// Whether to include PhysX APEX support.
///
[ConfigFile(ConfigHierarchyType.Engine, "/Script/BuildSettings.BuildSettings", "bCompileApex")]
public bool bCompileAPEX = true;
///
/// Whether to include NvCloth.
///
public bool bCompileNvCloth = false;
///
/// Whether to allow runtime cooking of physics.
///
public bool bRuntimePhysicsCooking = true;
///
/// Whether to include Box2D support.
///
[ConfigFile(ConfigHierarchyType.Engine, "/Script/BuildSettings.BuildSettings", "bCompileBox2D")]
public bool bCompileBox2D = true;
///
/// Whether to include ICU unicode/i18n support in Core.
///
[ConfigFile(ConfigHierarchyType.Engine, "/Script/BuildSettings.BuildSettings", "bCompileICU")]
public bool bCompileICU = true;
///
/// Whether to compile CEF3 support.
///
[ConfigFile(ConfigHierarchyType.Engine, "/Script/BuildSettings.BuildSettings", "bCompileCEF3")]
public bool bCompileCEF3 = true;
///
/// Whether to compile the editor or not. Only desktop platforms (Windows or Mac) will use this, other platforms force this to false.
///
[CommandLine("-NoEditor", Value = "false")]
public bool bBuildEditor = true;
///
/// Whether to compile code related to building assets. Consoles generally cannot build assets. Desktop platforms generally can.
///
public bool bBuildRequiresCookedData = false;
///
/// Whether to compile WITH_EDITORONLY_DATA disabled. Only Windows will use this, other platforms force this to false.
///
[CommandLine("-NoEditorOnlyData", Value = "false")]
public bool bBuildWithEditorOnlyData = true;
///
/// Whether to compile the developer tools.
///
public bool bBuildDeveloperTools = true;
///
/// Whether to force compiling the target platform modules, even if they wouldn't normally be built.
///
public bool bForceBuildTargetPlatforms = false;
///
/// Whether to force compiling shader format modules, even if they wouldn't normally be built.
///
public bool bForceBuildShaderFormats = false;
///
/// Whether we should compile in support for Simplygon or not.
///
[CommandLine("-WithSimplygon")]
[ConfigFile(ConfigHierarchyType.Engine, "/Script/BuildSettings.BuildSettings", "bCompileSimplygon")]
public bool bCompileSimplygon = true;
///
/// Whether we should compile in support for Simplygon's SSF library or not.
///
[ConfigFile(ConfigHierarchyType.Engine, "/Script/BuildSettings.BuildSettings", "bCompileSimplygonSSF")]
public bool bCompileSimplygonSSF = true;
///
/// Whether to compile lean and mean version of UE.
///
[ConfigFile(ConfigHierarchyType.Engine, "/Script/BuildSettings.BuildSettings", "bCompileLeanAndMeanUE")]
public bool bCompileLeanAndMeanUE = false;
///
/// Enabled for all builds that include the engine project. Disabled only when building standalone apps that only link with Core.
///
public bool bCompileAgainstEngine = true;
///
/// Enabled for all builds that include the CoreUObject project. Disabled only when building standalone apps that only link with Core.
///
public bool bCompileAgainstCoreUObject = true;
///
/// If true, include ADO database support in core.
///
[ConfigFile(ConfigHierarchyType.Engine, "/Script/BuildSettings.BuildSettings", "bIncludeADO")]
public bool bIncludeADO;
///
/// Whether to compile Recast navmesh generation.
///
[ConfigFile(ConfigHierarchyType.Engine, "/Script/BuildSettings.BuildSettings", "bCompileRecast")]
public bool bCompileRecast = true;
///
/// Whether to compile SpeedTree support.
///
[ConfigFile(ConfigHierarchyType.Engine, "/Script/BuildSettings.BuildSettings", "bCompileSpeedTree")]
public bool bCompileSpeedTree = true;
///
/// Enable exceptions for all modules.
///
public bool bForceEnableExceptions = false;
///
/// Enable RTTI for all modules.
///
public bool bForceEnableRTTI = false;
///
/// Compile server-only code.
///
public bool bWithServerCode = true;
///
/// Whether to include stats support even without the engine.
///
public bool bCompileWithStatsWithoutEngine = false;
///
/// Whether to include plugin support.
///
[ConfigFile(ConfigHierarchyType.Engine, "/Script/BuildSettings.BuildSettings", "bCompileWithPluginSupport")]
public bool bCompileWithPluginSupport = false;
///
/// Whether to include PerfCounters support.
///
[ConfigFile(ConfigHierarchyType.Engine, "/Script/BuildSettings.BuildSettings", "bWithPerfCounters")]
public bool bWithPerfCounters = false;
///
/// Whether to turn on logging for test/shipping builds.
///
public bool bUseLoggingInShipping = false;
///
/// Whether to turn on logging to memory for test/shipping builds.
///
public bool bLoggingToMemoryEnabled;
///
/// Whether to check that the process was launched through an external launcher.
///
public bool bUseLauncherChecks = false;
///
/// Whether to turn on checks (asserts) for test/shipping builds.
///
public bool bUseChecksInShipping = false;
///
/// True if we need FreeType support.
///
[ConfigFile(ConfigHierarchyType.Engine, "/Script/BuildSettings.BuildSettings", "bCompileFreeType")]
public bool bCompileFreeType = true;
///
/// True if we want to favor optimizing size over speed.
///
[ConfigFile(ConfigHierarchyType.Engine, "/Script/BuildSettings.BuildSettings", "bCompileForSize")]
public bool bCompileForSize = false;
///
/// Whether to compile development automation tests.
///
public bool bForceCompileDevelopmentAutomationTests = false;
///
/// Whether to compile performance automation tests.
///
public bool bForceCompilePerformanceAutomationTests = false;
///
/// If true, event driven loader will be used in cooked builds. @todoio This needs to be replaced by a runtime solution after async loading refactor.
///
public bool bEventDrivenLoader;
///
/// Enforce "include what you use" rules; warns if monolithic headers (Engine.h, UnrealEd.h, etc...) are used, and checks that source files include their matching header first.
///
public bool bEnforceIWYU = true;
///
/// Whether the final executable should export symbols.
///
public bool bHasExports = true;
///
/// Make static libraries for all engine modules as intermediates for this target.
///
[CommandLine("-Precompile")]
public bool bPrecompile = false;
///
/// Use existing static libraries for all engine modules in this target.
///
[CommandLine("-UsePrecompiled")]
public bool bUsePrecompiled = false;
///
/// Whether we should compile with support for OS X 10.9 Mavericks. Used for some tools that we need to be compatible with this version of OS X.
///
public bool bEnableOSX109Support = false;
///
/// True if this is a console application that's being built.
///
public bool bIsBuildingConsoleApplication = false;
///
/// True if debug symbols that are cached for some platforms should not be created.
///
public bool bDisableSymbolCache = true;
///
/// Whether to unify C++ code into larger files for faster compilation.
///
[CommandLine("-DisableUnity", Value = "false")]
[XmlConfigFile(Category = "BuildConfiguration")]
public bool bUseUnityBuild = true;
///
/// Whether to force C++ source files to be combined into larger files for faster compilation.
///
[CommandLine("-ForceUnity")]
[XmlConfigFile(Category = "BuildConfiguration")]
public bool bForceUnityBuild = false;
///
/// Use a heuristic to determine which files are currently being iterated on and exclude them from unity blobs, result in faster
/// incremental compile times. The current implementation uses the read-only flag to distinguish the working set, assuming that files will
/// be made writable by the source control system if they are being modified. This is true for Perforce, but not for Git.
///
[XmlConfigFile(Category = "BuildConfiguration")]
public bool bUseAdaptiveUnityBuild = true;
///
/// Disable optimization for files that are in the adaptive non-unity working set.
///
[XmlConfigFile(Category = "BuildConfiguration")]
public bool bAdaptiveUnityDisablesOptimizations = false;
///
/// Disables force-included PCHs for files that are in the adaptive non-unity working set.
///
[XmlConfigFile(Category = "BuildConfiguration")]
public bool bAdaptiveUnityDisablesPCH = true;
///
/// The number of source files in a game module before unity build will be activated for that module. This
/// allows small game modules to have faster iterative compile times for single files, at the expense of slower full
/// rebuild times. This setting can be overridden by the bFasterWithoutUnity option in a module's Build.cs file.
///
[XmlConfigFile(Category = "BuildConfiguration")]
public int MinGameModuleSourceFilesForUnityBuild = 32;
///
/// Forces shadow variable warnings to be treated as errors on platforms that support it.
///
[CommandLine("-ShadowVariableErrors")]
[XmlConfigFile(Category = "BuildConfiguration")]
public bool bShadowVariableErrors = false;
///
/// Forces the use of undefined identifiers in conditional expressions to be treated as errors.
///
[XmlConfigFile(Category = "BuildConfiguration")]
public bool bUndefinedIdentifierErrors = false;
///
/// New Monolithic Graphics drivers have optional "fast calls" replacing various D3d functions
///
[CommandLine("-FastMonoCalls", Value = "true")]
[CommandLine("-NoFastMonoCalls", Value = "false")]
[XmlConfigFile(Category = "BuildConfiguration")]
public bool bUseFastMonoCalls = true;
///
/// New Xbox driver supports a "fast semantics" context type. This switches it on for the immediate and deferred contexts
/// Try disabling this if you see rendering issues and/or crashes inthe Xbox RHI.
///
[XmlConfigFile(Category = "BuildConfiguration")]
public bool bUseFastSemanticsRenderContexts = true;
///
/// An approximate number of bytes of C++ code to target for inclusion in a single unified C++ file.
///
[XmlConfigFile(Category = "BuildConfiguration")]
public int NumIncludedBytesPerUnityCPP = 384 * 1024;
///
/// Whether to stress test the C++ unity build robustness by including all C++ files files in a project from a single unified file.
///
[CommandLine("-StressTestUnity")]
[XmlConfigFile(Category = "BuildConfiguration")]
public bool bStressTestUnity = false;
///
/// Whether to force debug info to be generated.
///
[CommandLine("-ForceDebugInfo")]
public bool bForceDebugInfo = false;
///
/// Whether to globally disable debug info generation; see DebugInfoHeuristics.cs for per-config and per-platform options.
///
[CommandLine("-NoDebugInfo")]
[XmlConfigFile(Category = "BuildConfiguration")]
public bool bDisableDebugInfo = false;
///
/// Whether to disable debug info generation for generated files. This improves link times for modules that have a lot of generated glue code.
///
[XmlConfigFile(Category = "BuildConfiguration")]
public bool bDisableDebugInfoForGeneratedCode = true;
///
/// Whether to disable debug info on PC in development builds (for faster developer iteration, as link times are extremely fast with debug info disabled).
///
[XmlConfigFile(Category = "BuildConfiguration")]
public bool bOmitPCDebugInfoInDevelopment = false;
///
/// Whether PDB files should be used for Visual C++ builds.
///
[CommandLine("-NoPDB", Value = "false")]
[XmlConfigFile(Category = "BuildConfiguration")]
public bool bUsePDBFiles = false;
///
/// Whether PCH files should be used.
///
[CommandLine("-NoPCH", Value = "false")]
[XmlConfigFile(Category = "BuildConfiguration")]
public bool bUsePCHFiles = true;
///
/// The minimum number of files that must use a pre-compiled header before it will be created and used.
///
[XmlConfigFile(Category = "BuildConfiguration")]
public int MinFilesUsingPrecompiledHeader = 6;
///
/// When enabled, a precompiled header is always generated for game modules, even if there are only a few source files
/// in the module. This greatly improves compile times for iterative changes on a few files in the project, at the expense of slower
/// full rebuild times for small game projects. This can be overridden by setting MinFilesUsingPrecompiledHeaderOverride in
/// a module's Build.cs file.
///
[XmlConfigFile(Category = "BuildConfiguration")]
public bool bForcePrecompiledHeaderForGameModules = true;
///
/// Whether to use incremental linking or not. Incremental linking can yield faster iteration times when making small changes.
/// Currently disabled by default because it tends to behave a bit buggy on some computers (PDB-related compile errors).
///
[XmlConfigFile(Category = "BuildConfiguration")]
public bool bUseIncrementalLinking = false;
///
/// Whether to allow the use of link time code generation (LTCG).
///
[CommandLine("-NoLTCG", Value = "false")]
[XmlConfigFile(Category = "BuildConfiguration")]
public bool bAllowLTCG = false;
///
/// Whether to allow the use of ASLR (address space layout randomization) if supported. Only
/// applies to shipping builds.
///
[XmlConfigFile(Category = "BuildConfiguration")]
public bool bAllowASLRInShipping = true;
///
/// Whether to support edit and continue. Only works on Microsoft compilers in 32-bit compiles.
///
[XmlConfigFile(Category = "BuildConfiguration")]
public bool bSupportEditAndContinue = false;
///
/// Whether to omit frame pointers or not. Disabling is useful for e.g. memory profiling on the PC.
///
[XmlConfigFile(Category = "BuildConfiguration")]
public bool bOmitFramePointers = true;
///
/// Whether to strip iOS symbols or not (implied by bGeneratedSYMFile).
///
[XmlConfigFile(Category = "BuildConfiguration")]
public bool bStripSymbolsOnIOS = false;
///
/// If true, then enable memory profiling in the build (defines USE_MALLOC_PROFILER=1 and forces bOmitFramePointers=false).
///
[XmlConfigFile(Category = "BuildConfiguration")]
public bool bUseMallocProfiler = false;
///
/// Enables "Shared PCHs", a feature which significantly speeds up compile times by attempting to
/// share certain PCH files between modules that UBT detects is including those PCH's header files.
///
[CommandLine("-NoSharedPCH", Value = "false")]
[XmlConfigFile(Category = "BuildConfiguration")]
public bool bUseSharedPCHs = true;
///
/// True if Development and Release builds should use the release configuration of PhysX/APEX.
///
[XmlConfigFile(Category = "BuildConfiguration")]
public bool bUseShippingPhysXLibraries = false;
///
/// True if Development and Release builds should use the checked configuration of PhysX/APEX. if bUseShippingPhysXLibraries is true this is ignored.
///
[XmlConfigFile(Category = "BuildConfiguration")]
public bool bUseCheckedPhysXLibraries = false;
///
/// Tells the UBT to check if module currently being built is violating EULA.
///
[XmlConfigFile(Category = "BuildConfiguration")]
public bool bCheckLicenseViolations = true;
///
/// Tells the UBT to break build if module currently being built is violating EULA.
///
[XmlConfigFile(Category = "BuildConfiguration")]
public bool bBreakBuildOnLicenseViolation = true;
///
/// Whether to use the :FASTLINK option when building with /DEBUG to create local PDBs on Windows. Fast, but currently seems to have problems finding symbols in the debugger.
///
[CommandLine("-FastPDB")]
[XmlConfigFile(Category = "BuildConfiguration")]
public bool bUseFastPDBLinking = false;
///
/// Outputs a map file as part of the build.
///
[CommandLine("-MapFile")]
[XmlConfigFile(Category = "BuildConfiguration")]
public bool bCreateMapFile = false;
///
/// Enables code analysis mode. Currently, this has specific requirements. It only works on Windows
/// platform with the MSVC compiler. Also, it requires a version of the compiler that supports the
/// /analyze option, such as Visual Studio 2013.
///
[CommandLine("-EnableCodeAnalysis")]
[XmlConfigFile(Category = "BuildConfiguration")]
public bool bEnableCodeAnalysis = false;
///
/// Bundle version for Mac apps.
///
[CommandLine("-BundleVersion")]
public string BundleVersion = null;
///
/// Whether to deploy the executable after compilation on platforms that require deployment.
///
[CommandLine("-Deploy")]
public bool bDeployAfterCompile = false;
///
/// If true, then a stub IPA will be generated when compiling is done (minimal files needed for a valid IPA).
///
[CommandLine("-NoCreateStub", Value = "false")]
public bool bCreateStubIPA = true;
///
/// If true, then a stub IPA will be generated when compiling is done (minimal files needed for a valid IPA).
///
[CommandLine("-CopyAppBundleBackToDevice")]
public bool bCopyAppBundleBackToDevice = false;
///
/// When enabled, allows XGE to compile pre-compiled header files on remote machines. Otherwise, PCHs are always generated locally.
///
public bool bAllowRemotelyCompiledPCHs = false;
///
/// Whether headers in system paths should be checked for modification when determining outdated actions.
///
[XmlConfigFile(Category = "BuildConfiguration")]
public bool bCheckSystemHeadersForModification;
///
/// Whether to disable linking for this target.
///
[CommandLine("-NoLink")]
public bool bDisableLinking = false;
///
/// Indicates that this is a formal build, intended for distribution. This flag is automatically set to true when Build.version has a changelist set.
/// The only behavior currently bound to this flag is to compile the default resource file separately for each binary so that the OriginalFilename field is set correctly.
/// By default, we only compile the resource once to reduce build times.
///
[CommandLine("-Formal")]
public bool bFormalBuild = false;
///
/// Whether to clean Builds directory on a remote Mac before building.
///
[CommandLine("-FlushMac")]
[XmlConfigFile(Category = "BuildConfiguration")]
public bool bFlushBuildDirOnRemoteMac = false;
///
/// Whether to write detailed timing info from the compiler and linker.
///
[CommandLine("-Timing")]
[XmlConfigFile(Category = "BuildConfiguration")]
public bool bPrintToolChainTimingInfo = false;
///
/// The directory to put precompiled header files in. Experimental setting to allow using a path on a faster drive. Defaults to the standard output directory if not set.
///
[XmlConfigFile(Category = "BuildConfiguration")]
public string PCHOutputDirectory = null;
///
/// Specifies how to link modules in this target (monolithic or modular). This is currently protected for backwards compatibility. Call the GetLinkType() accessor
/// until support for the deprecated ShouldCompileMonolithic() override has been removed.
///
public TargetLinkType LinkType
{
get
{
return (LinkTypePrivate != TargetLinkType.Default) ? LinkTypePrivate : ((Type == global::UnrealBuildTool.TargetType.Editor) ? TargetLinkType.Modular : TargetLinkType.Monolithic);
}
set
{
LinkTypePrivate = value;
}
}
///
/// Backing storage for the LinkType property.
///
[CommandLine("-Monolithic", Value ="Monolithic")]
[CommandLine("-Modular", Value ="Modular")]
TargetLinkType LinkTypePrivate = TargetLinkType.Default;
///
/// Macros to define globally across the whole target.
///
[CommandLine("-Define", ValueAfterSpace = true)]
public List GlobalDefinitions = new List();
///
/// Specifies the name of the launch module. For modular builds, this is the module that is compiled into the target's executable.
///
public string LaunchModuleName
{
get
{
return (LaunchModuleNamePrivate == null && Type != global::UnrealBuildTool.TargetType.Program)? "Launch" : LaunchModuleNamePrivate;
}
set
{
LaunchModuleNamePrivate = value;
}
}
///
/// Backing storage for the LaunchModuleName property.
///
private string LaunchModuleNamePrivate;
///
/// List of additional modules to be compiled into the target.
///
public List ExtraModuleNames = new List();
///
/// Specifies the build environment for this target. See TargetBuildEnvironment for more infomation on the available options.
///
public TargetBuildEnvironment BuildEnvironment = TargetBuildEnvironment.Default;
///
/// Android-specific target settings.
///
public AndroidTargetRules AndroidPlatform = new AndroidTargetRules();
///
/// Mac-specific target settings.
///
public MacTargetRules MacPlatform = new MacTargetRules();
///
/// PS4-specific target settings.
///
public PS4TargetRules PS4Platform = new PS4TargetRules();
///
/// Windows-specific target settings.
///
public WindowsTargetRules WindowsPlatform = new WindowsTargetRules();
///
/// Xbox One-specific target settings.
///
public XboxOneTargetRules XboxOnePlatform = new XboxOneTargetRules();
///
/// Default constructor (deprecated; use the constructor below instead).
///
[Obsolete("Please pass the TargetInfo parameter to the base class constructor (eg. \"MyTargetRules(TargetInfo Target) : base(Target)\").")]
public TargetRules()
{
InternalConstructor();
}
///
/// Default constructor. Since the parameterless TargetRules constructor is still supported for now, initialization that should happen here
/// is currently done in TargetRules.CreateTargetRulesInstance() instead.
///
/// Information about the target being built
public TargetRules(TargetInfo Target)
{
InternalConstructor();
}
///
/// Initialize this object, using the readonly fields set by RulesAssembly.CreateTargetRulesInstance.
///
private void InternalConstructor()
{
// Read settings from config files
foreach(object ConfigurableObject in GetConfigurableObjects())
{
ConfigCache.ReadSettings(DirectoryReference.FromFile(ProjectFile), Platform, ConfigurableObject);
}
// Read settings from the XML config files
XmlConfig.ApplyTo(this);
// Allow the build platform to set defaults for this target
if(Platform != UnrealTargetPlatform.Unknown)
{
UEBuildPlatform.GetBuildPlatform(Platform).ResetTarget(this);
}
// If the engine is installed, always use precompiled libraries
bUsePrecompiled = UnrealBuildTool.IsEngineInstalled();
// Check that the appropriate headers exist to enable Simplygon
if(bCompileSimplygon)
{
FileReference HeaderFile = FileReference.Combine(UnrealBuildTool.EngineDirectory, "Source", "ThirdParty", "NotForLicensees", "Simplygon", "Simplygon-latest", "Inc", "SimplygonSDK.h");
if(!FileReference.Exists(HeaderFile))
{
bCompileSimplygon = false;
}
}
if(bCompileSimplygonSSF)
{
FileReference HeaderFile = FileReference.Combine(UnrealBuildTool.EngineDirectory, "Source", "ThirdParty", "NotForLicensees", "SSF", "Public", "ssf.h");
if(!FileReference.Exists(HeaderFile))
{
bCompileSimplygonSSF = false;
}
}
// If we've got a changelist set, set that we're making a formal build
BuildVersion Version;
if (BuildVersion.TryRead(out Version))
{
bFormalBuild = (Version.Changelist != 0 && Version.IsPromotedBuild != 0);
}
if (bCreateStubIPA && (String.IsNullOrEmpty(Environment.GetEnvironmentVariable("uebp_LOCAL_ROOT")) && BuildHostPlatform.Current.Platform == UnrealTargetPlatform.Mac))
{
bCreateStubIPA = false;
}
}
///
/// Override any settings required for the selected target type
///
internal void SetOverridesForTargetType()
{
if(Type == global::UnrealBuildTool.TargetType.Game)
{
bCompileLeanAndMeanUE = true;
// Do not include the editor
bBuildEditor = false;
bBuildWithEditorOnlyData = false;
// Require cooked data
bBuildRequiresCookedData = true;
// Compile the engine
bCompileAgainstEngine = true;
// no exports, so no need to verify that a .lib and .exp file was emitted by the linker.
bHasExports = false;
// Tag it as a 'Game' build
GlobalDefinitions.Add("UE_GAME=1");
}
else if(Type == global::UnrealBuildTool.TargetType.Client)
{
bCompileLeanAndMeanUE = true;
// Do not include the editor
bBuildEditor = false;
bBuildWithEditorOnlyData = false;
// Require cooked data
bBuildRequiresCookedData = true;
// Compile the engine
bCompileAgainstEngine = true;
// Disable server code
bWithServerCode = false;
// no exports, so no need to verify that a .lib and .exp file was emitted by the linker.
bHasExports = false;
// Tag it as a 'Game' build
GlobalDefinitions.Add("UE_GAME=1");
}
else if(Type == global::UnrealBuildTool.TargetType.Editor)
{
bCompileLeanAndMeanUE = false;
// Do not include the editor
bBuildEditor = true;
bBuildWithEditorOnlyData = true;
// Require cooked data
bBuildRequiresCookedData = false;
// Compile the engine
bCompileAgainstEngine = true;
//enable PerfCounters
bWithPerfCounters = true;
// Tag it as a 'Editor' build
GlobalDefinitions.Add("UE_EDITOR=1");
}
else if(Type == global::UnrealBuildTool.TargetType.Server)
{
bCompileLeanAndMeanUE = true;
// Do not include the editor
bBuildEditor = false;
bBuildWithEditorOnlyData = false;
// Require cooked data
bBuildRequiresCookedData = true;
// Compile the engine
bCompileAgainstEngine = true;
//enable PerfCounters
bWithPerfCounters = true;
// no exports, so no need to verify that a .lib and .exp file was emitted by the linker.
bHasExports = false;
// Tag it as a 'Server' build
GlobalDefinitions.Add("UE_SERVER=1");
GlobalDefinitions.Add("USE_NULL_RHI=1");
}
}
///
/// Finds all the subobjects which can be configured by command line options and config files
///
/// Sequence of objects
internal IEnumerable