Unreal Build System Target Files

Choose your OS:

Overview

UnrealBuildTool supports building several target types:

  • Game - A standalone game which requires cooked data to run.

  • Client - Same as Game, but does not include any server code. Useful for networked games.

  • Server - Same as Game, but does not include any client code. Useful for dedicated servers in networked games.

  • Editor - A target which extends the Unreal Editor.

  • Program - A standalone utility program built on top of the Unreal Engine.

Targets are declared through C# source files with a .target.cs extension, and are stored under your project's Source directory. Each .target.cs file declares a class deriving from the TargetRules base class, and sets properties controlling how it should be built from its constructor. When asked to build a target, UnrealBuildTool will compile your target.cs file and construct the class inside it to determine its settings.

The name of the class must match the name of the file it's declared in followed by 'Target' (so for example, MyProject.target.cs defines the class 'MyProjectTarget').

The typical structure for a target file is as follows.

using UnrealBuildTool;
using System.Collections.Generic;

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

        // Other properties go here
    }
}

Read-Only Properties

Name (String)

The name of this target.

Platform (UnrealTargetPlatform)

Platform that this target is being built for.

Configuration (UnrealTargetConfiguration)

The configuration being built.

Architecture (String)

Architecture that the target is being built for (or an empty string for the default).

ProjectFile (FileReference)

Path to the project file for the project containing this target.

Read/Write Properties

Type (TargetType)

The type of target.

bUsesSteam (Boolean)

Whether the target uses Steam.

bUsesCEF3 (Boolean)

Whether the target uses CEF3.

bUsesSlate (Boolean)

Whether the project uses visual Slate UI (as opposed to the low level windowing/messaging, which is always available).

bUseStaticCRT (Boolean)

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.

bDebugBuildsActuallyUseDebugCRT (Boolean)

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.

bOutputPubliclyDistributable (Boolean)

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).

UndecoratedConfiguration (UnrealTargetConfiguration)

Specifies the configuration whose binaries do not require a "-Platform-Configuration" suffix.

bBuildAllPlugins (Boolean)

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.

AdditionalPlugins (List<String>)

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.

PakSigningKeysFile (String)

Path to the set of pak signing keys to embed in the executable.

SolutionDirectory (String)

Allows a Program Target to specify it's own solution folder path.

bBuildInSolutionByDefault (Nullable<Boolean>)

Whether the target should be included in the default solution build configuration

bOutputToEngineBinaries (Boolean)

Output the executable to the engine binaries folder.

bShouldCompileAsDLL (Boolean)

Whether this target should be compiled as a DLL. Requires LinkType to be set to TargetLinkType.Monolithic.

ExeBinariesSubFolder (String)

Subfolder to place executables in, relative to the default location.

GeneratedCodeVersion (EGeneratedCodeVersion)

Allow target module to override UHT code generation version.

bCompilePhysX (Boolean)

Whether to include PhysX support.

bCompileAPEX (Boolean)

Whether to include PhysX APEX support.

bCompileNvCloth (Boolean)

Whether to include NvCloth.

bCompileBox2D (Boolean)

Whether to include Box2D support.

bCompileICU (Boolean)

Whether to include ICU unicode/i18n support in Core.

bCompileCEF3 (Boolean)

Whether to compile CEF3 support.

bBuildEditor (Boolean)

Whether to compile the editor or not. Only desktop platforms (Windows or Mac) will use this, other platforms force this to false.

bBuildRequiresCookedData (Boolean)

Whether to compile code related to building assets. Consoles generally cannot build assets. Desktop platforms generally can.

bBuildWithEditorOnlyData (Boolean)

Whether to compile WITH_EDITORONLY_DATA disabled. Only Windows will use this, other platforms force this to false.

bBuildDeveloperTools (Boolean)

Whether to compile the developer tools.

bForceBuildTargetPlatforms (Boolean)

Whether to force compiling the target platform modules, even if they wouldn't normally be built.

bForceBuildShaderFormats (Boolean)

Whether to force compiling shader format modules, even if they wouldn't normally be built.

bCompileSimplygon (Boolean)

Whether we should compile in support for Simplygon or not.

bCompileSimplygonSSF (Boolean)

Whether we should compile in support for Simplygon's SSF library or not.

bCompileLeanAndMeanUE (Boolean)

Whether to compile lean and mean version of UE.

bUseCacheFreedOSAllocs (Boolean)

Whether to utilize cache freed OS allocs with MallocBinned

bCompileAgainstEngine (Boolean)

Enabled for all builds that include the engine project. Disabled only when building standalone apps that only link with Core.

bCompileAgainstCoreUObject (Boolean)

Enabled for all builds that include the CoreUObject project. Disabled only when building standalone apps that only link with Core.

bIncludeADO (Boolean)

If true, include ADO database support in core.

bCompileRecast (Boolean)

Whether to compile Recast navmesh generation.

bCompileSpeedTree (Boolean)

Whether to compile SpeedTree support.

bForceEnableExceptions (Boolean)

Enable exceptions for all modules.

bForceEnableRTTI (Boolean)

Enable RTTI for all modules.

bWithServerCode (Boolean)

Compile server-only code.

bCompileWithStatsWithoutEngine (Boolean)

Whether to include stats support even without the engine.

bCompileWithPluginSupport (Boolean)

Whether to include plugin support.

bWithPerfCounters (Boolean)

Whether to include PerfCounters support.

bUseLoggingInShipping (Boolean)

Whether to turn on logging for test/shipping builds.

bLoggingToMemoryEnabled (Boolean)

Whether to turn on logging to memory for test/shipping builds.

bUseLauncherChecks (Boolean)

Whether to check that the process was launched through an external launcher.

bUseChecksInShipping (Boolean)

Whether to turn on checks (asserts) for test/shipping builds.

bCompileFreeType (Boolean)

True if we need FreeType support.

bCompileForSize (Boolean)

True if we want to favor optimizing size over speed.

bForceCompileDevelopmentAutomationTests (Boolean)

Whether to compile development automation tests.

bForceCompilePerformanceAutomationTests (Boolean)

Whether to compile performance automation tests.

bEventDrivenLoader (Boolean)

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.

bEnforceIWYU (Boolean)

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.

bHasExports (Boolean)

Whether the final executable should export symbols.

bPrecompile (Boolean)

Make static libraries for all engine modules as intermediates for this target.

bUsePrecompiled (Boolean)

Use existing static libraries for all engine modules in this target.

bEnableOSX109Support (Boolean)

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.

bIsBuildingConsoleApplication (Boolean)

True if this is a console application that's being built.

bDisableSymbolCache (Boolean)

True if debug symbols that are cached for some platforms should not be created.

bUseUnityBuild (Boolean)

Whether to unify C++ code into larger files for faster compilation.

bForceUnityBuild (Boolean)

Whether to force C++ source files to be combined into larger files for faster compilation.

bUseAdaptiveUnityBuild (Boolean)

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.

bAdaptiveUnityDisablesOptimizations (Boolean)

Disable optimization for files that are in the adaptive non-unity working set.

bAdaptiveUnityDisablesPCH (Boolean)

Disables force-included PCHs for files that are in the adaptive non-unity working set.

MinGameModuleSourceFilesForUnityBuild (Int32)

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.

bShadowVariableErrors (Boolean)

Forces shadow variable warnings to be treated as errors on platforms that support it.

bUndefinedIdentifierErrors (Boolean)

Forces the use of undefined identifiers in conditional expressions to be treated as errors.

bUseFastMonoCalls (Boolean)

New Monolithic Graphics drivers have optional "fast calls" replacing various D3d functions

bUseFastSemanticsRenderContexts (Boolean)

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.

NumIncludedBytesPerUnityCPP (Int32)

An approximate number of bytes of C++ code to target for inclusion in a single unified C++ file.

bStressTestUnity (Boolean)

Whether to stress test the C++ unity build robustness by including all C++ files files in a project from a single unified file.

bForceDebugInfo (Boolean)

Whether to force debug info to be generated.

bDisableDebugInfo (Boolean)

Whether to globally disable debug info generation; see DebugInfoHeuristics.cs for per-config and per-platform options.

bDisableDebugInfoForGeneratedCode (Boolean)

Whether to disable debug info generation for generated files. This improves link times for modules that have a lot of generated glue code.

bOmitPCDebugInfoInDevelopment (Boolean)

Whether to disable debug info on PC in development builds (for faster developer iteration, as link times are extremely fast with debug info disabled).

bUsePDBFiles (Boolean)

Whether PDB files should be used for Visual C++ builds.

bUsePCHFiles (Boolean)

Whether PCH files should be used.

MinFilesUsingPrecompiledHeader (Int32)

The minimum number of files that must use a pre-compiled header before it will be created and used.

bForcePrecompiledHeaderForGameModules (Boolean)

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.

bUseIncrementalLinking (Boolean)

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).

bAllowLTCG (Boolean)

Whether to allow the use of link time code generation (LTCG).

bAllowASLRInShipping (Boolean)

Whether to allow the use of ASLR (address space layout randomization) if supported. Only applies to shipping builds.

bSupportEditAndContinue (Boolean)

Whether to support edit and continue. Only works on Microsoft compilers in 32-bit compiles.

bOmitFramePointers (Boolean)

Whether to omit frame pointers or not. Disabling is useful for e.g. memory profiling on the PC.

bStripSymbolsOnIOS (Boolean)

Whether to strip iOS symbols or not (implied by bGeneratedSYMFile).

bUseMallocProfiler (Boolean)

If true, then enable memory profiling in the build (defines USE_MALLOC_PROFILER=1 and forces bOmitFramePointers=false).

bUseSharedPCHs (Boolean)

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.

bUseShippingPhysXLibraries (Boolean)

True if Development and Release builds should use the release configuration of PhysX/APEX.

bUseCheckedPhysXLibraries (Boolean)

True if Development and Release builds should use the checked configuration of PhysX/APEX. if bUseShippingPhysXLibraries is true this is ignored.

bCheckLicenseViolations (Boolean)

Tells the UBT to check if module currently being built is violating EULA.

bBreakBuildOnLicenseViolation (Boolean)

Tells the UBT to break build if module currently being built is violating EULA.

bUseFastPDBLinking (Boolean): 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.

bCreateMapFile (Boolean)

Outputs a map file as part of the build.

BundleVersion (String)

Bundle version for Mac apps.

bDeployAfterCompile (Boolean)

Whether to deploy the executable after compilation on platforms that require deployment.

bCreateStubIPA (Boolean)

If true, then a stub IPA will be generated when compiling is done (minimal files needed for a valid IPA).

bCopyAppBundleBackToDevice (Boolean)

If true, then a stub IPA will be generated when compiling is done (minimal files needed for a valid IPA).

bAllowRemotelyCompiledPCHs (Boolean)

When enabled, allows XGE to compile pre-compiled header files on remote machines. Otherwise, PCHs are always generated locally.

bCheckSystemHeadersForModification (Boolean)

Whether headers in system paths should be checked for modification when determining outdated actions.

bDisableLinking (Boolean)

Whether to disable linking for this target.

bFormalBuild (Boolean)

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.

bFlushBuildDirOnRemoteMac (Boolean)

Whether to clean Builds directory on a remote Mac before building.

bPrintToolChainTimingInfo (Boolean)

Whether to write detailed timing info from the compiler and linker.

PCHOutputDirectory (String)

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.

GlobalDefinitions (List<String>)

Macros to define globally across the whole target.

ExtraModuleNames (List<String>)

List of additional modules to be compiled into the target.

BuildEnvironment (TargetBuildEnvironment)

Specifies the build environment for this target. See TargetBuildEnvironment for more infomation on the available options.

OverrideExecutableFileExtension (String)

Can be set to override the file extension of the executable file (normally .exe or .dll on Windows, for example)