2014-03-14 14:13:41 -04:00
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
using System ;
using System.IO ;
using System.Collections.Generic ;
2014-04-02 18:09:23 -04:00
using System.Xml ;
using System.Reflection ;
2014-03-14 14:13:41 -04:00
namespace UnrealBuildTool
{
public class BuildConfiguration
{
/// <summary>
/// Whether to unify C++ code into larger files for faster compilation.
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bUseUnityBuild ;
/// <summary>
/// Whether to _force_ unify C++ code into larger files for faster compilation.
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bForceUnityBuild ;
/// <summary>
/// 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.
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static int MinGameModuleSourceFilesForUnityBuild ;
/// <summary>
/// New Monolithic Graphics drivers have optional "fast calls" replacing various D3d functions
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
public static bool bUseFastMonoCalls ;
2014-03-14 14:13:41 -04:00
/// <summary>
/// An approximate number of bytes of C++ code to target for inclusion in a single unified C++ file.
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static int NumIncludedBytesPerUnityCPP ;
/// <summary>
/// Whether to stress test the C++ unity build robustness by including all C++ files files in a project from a single unified file.
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bStressTestUnity ;
/// <summary>
/// Whether headers in system paths should be checked for modification when determining outdated actions.
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bCheckSystemHeadersForModification ;
/// <summary>
/// Whether headers in the Development\External folder should be checked for modification when determining outdated actions.
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bCheckExternalHeadersForModification ;
/// <summary>
/// Whether to ignore import library files that are out of date when building targets. Set this to true to improve iteration time.
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bIgnoreOutdatedImportLibraries ;
/// <summary>
/// Whether to globally disable debug info generation; see DebugInfoHeuristics.cs for per-config and per-platform options.
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bDisableDebugInfo ;
/// <summary>
/// Whether to disable debug info on PC in development builds (for faster developer iteration, as link times are extremely fast with debug info disabled.)
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bOmitPCDebugInfoInDevelopment ;
/// <summary>
/// Whether PDB files should be used for Visual C++ builds.
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bUsePDBFiles ;
/// <summary>
/// Whether PCH files should be used.
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bUsePCHFiles ;
/// <summary>
/// Whether to generate command line dependencies for compile actions when requested
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bUseActionHistory ;
/// <summary>
/// The minimum number of files that must use a pre-compiled header before it will be created and used.
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static int MinFilesUsingPrecompiledHeader ;
/// <summary>
/// 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
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bForcePrecompiledHeaderForGameModules ;
/// <summary>
/// Whether debug info should be written to the console.
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bPrintDebugInfo ;
/// <summary>
/// Prints performance diagnostics about include dependencies and other bits
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bPrintPerformanceInfo ;
/// <summary>
/// Whether to log detailed action stats. This forces local execution.
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bLogDetailedActionStats ;
/// <summary>
/// Whether to deploy the executable after compilation on platforms that require deployment.
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bDeployAfterCompile ;
/// <summary>
/// Whether to clean Builds directory on a remote Mac before building
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bFlushBuildDirOnRemoteMac ;
/// <summary>
/// Whether XGE may be used.
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bAllowXGE ;
/// <summary>
/// Whether we should just export the XGE XML and pretend it succeeded
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bXGEExport ;
/// <summary>
/// Whether to display the XGE build monitor.
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bShowXGEMonitor ;
/// <summary>
/// When enabled, XGE will stop compiling targets after a compile error occurs. Recommended, as it saves computing resources for others.
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bStopXGECompilationAfterErrors ;
/// <summary>
/// When enabled, allows XGE to compile pre-compiled header files on remote machines. Otherwise, PCHs are always generated locally.
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bAllowRemotelyCompiledPCHs ;
/// <summary>
/// Whether or not to delete outdated produced items.
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bShouldDeleteAllOutdatedProducedItems ;
/// <summary>
/// Whether to use incremental linking or not.
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bUseIncrementalLinking ;
/// <summary>
/// Whether to allow the use of LTCG (link time code generation)
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bAllowLTCG ;
/// <summary>
/// Whether to support edit and continue. Only works on Microsoft compilers in 32-bit compiles.
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bSupportEditAndContinue ;
/// <summary>
/// Whether to omit frame pointers or not. Disabling is useful for e.g. memory profiling on the PC
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bOmitFramePointers ;
/// <summary>
/// Processor count multiplier for local execution. Can be below 1 to reserve CPU for other tasks.
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static double ProcessorCountMultiplier ;
2014-09-25 08:10:40 -04:00
/// <summary>
/// Maximum processor count for local execution.
/// </summary>
[XmlConfig]
public static int MaxProcessorCount ;
2014-03-14 14:13:41 -04:00
/// <summary>
/// The intermediate folder - i.e. Intermediate/Build.
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static string BaseIntermediateFolder ;
/// <summary>
/// Relative root engine path.
/// </summary>
2014-09-04 10:24:49 -04:00
private static string _RelativeEnginePath = "../../Engine/" ;
2014-03-14 14:13:41 -04:00
public static string RelativeEnginePath
{
get
{
2014-09-04 10:24:49 -04:00
return _RelativeEnginePath ;
}
set
{
_RelativeEnginePath = value ;
2014-03-14 14:13:41 -04:00
}
}
/// <summary>
/// The path to the intermediate folder, relative to Engine/Source.
/// </summary>
public static string BaseIntermediatePath
{
get
{
return RelativeEnginePath + BaseIntermediateFolder ;
}
}
/// <summary>
/// The intermediate folder - i.e. Intermediate/Build/Platform[-Architecture] for the current platform
/// </summary>
private static string _PlatformIntermediateFolder = null ;
public static string PlatformIntermediateFolder
{
get
{
if ( _PlatformIntermediateFolder = = null )
{
throw new BuildException ( "Attempted to use PlatformIntermediateFolder before it was initialized" ) ;
}
return _PlatformIntermediateFolder ;
}
set { _PlatformIntermediateFolder = value ; }
}
/// <summary>
/// The path to the platform intermediate folder, relative to Engine/Source.
/// </summary>
public static string PlatformIntermediatePath
{
get
{
return RelativeEnginePath + PlatformIntermediateFolder ;
}
}
/// <summary>
/// Whether to generate a dSYM file or not.
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bGeneratedSYMFile ;
/// <summary>
/// Whether to strip iOS symbols or not (implied by bGeneratedSYMFile).
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bStripSymbolsOnIOS ;
/// <summary>
/// If true, then a stub IPA will be generated when compiling is done (minimal files needed for a valid IPA)
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bCreateStubIPA ;
/// <summary>
/// If true, then a stub IPA will be generated when compiling is done (minimal files needed for a valid IPA)
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bCopyAppBundleBackToDevice ;
/// <summary>
/// If true, then enable memory profiling in the build (defines USE_MALLOC_PROFILER=1 and forces bOmitFramePointers=false)
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bUseMallocProfiler ;
/// <summary>
/// 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
2014-08-15 16:13:57 -04:00
/// /analyze option, such as Visual Studio 2013
2014-03-14 14:13:41 -04:00
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bEnableCodeAnalysis ;
/// <summary>
/// Enables "Shared PCHs", an experimental feature which may significantly speed up compile times by attempting to
/// share certain PCH files between modules that UBT detects is including those PCH's header files
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bUseSharedPCHs ;
/// <summary>
/// Whether the dependency cache includes pre-resolved include locations so UBT doesn't have to re-resolve each include location just to check the timestamp.
/// This is technically not fully correct because the dependency cache is global and each module could have a different set of include paths that could cause headers
/// to resolve files differently. In practice this is not the case, and significantly speeds up UBT when nothing is to be done.
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bUseIncludeDependencyResolveCache ;
/// <summary>
/// Used to test the dependency resolve cache. This will verify the resolve cache has no conflicts by resolving every time and checking against any previous resolve attempts.
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bTestIncludeDependencyResolveCache ;
/// <summary>
/// True if we should compile Debug builds using Debug CRT libs and Debug third party dependencies. Otherwise, we'll actually
/// compile against the Release CRT but leave optimizations turned off, so that it is still easy to debug. If you enable this
/// setting, actual Debug versions of third party static libraries will be needed when compiling in Debug.
/// </summary>
2014-06-06 07:43:02 -04:00
[XmlConfig]
2014-03-14 14:13:41 -04:00
public static bool bDebugBuildsActuallyUseDebugCRT ;
2014-07-21 15:05:48 -04:00
/// <summary>
/// Tells the UBT to check if module currently being built is violating EULA.
/// </summary>
[XmlConfig]
public static bool bCheckLicenseViolations ;
2014-07-21 04:28:22 -04:00
/// <summary>
/// Tells the UBT to break build if module currently being built is violating EULA.
/// </summary>
[XmlConfig]
public static bool bBreakBuildOnLicenseViolation ;
2014-07-31 09:34:11 -04:00
/// <summary>
/// True if we should use the new 'experimental' C++ header dependency scanning and caching system that allows Unreal Build Tool to
/// detect out of date dependencies very quickly. When enabled, a deep C++ include graph does not have to be generated, and instead
/// we only scan and cache indirect includes for after a dependent build product was already found to be out of date. During the
/// next build, we'll load those cached indirect includes and check for outdatedness.
/// </summary>
[XmlConfig]
public static bool bUseExperimentalFastDependencyScan ;
Experimental UnrealBuildTool makefile support
UnrealBuildTool 'Makefiles' allow for very fast iterative builds.
- New BuildConfiguration.xml setting added: "bUseExperimentalFastBuildIteration" (disabled by default)
- Turning this on causes Unreal Build Tool to emit 'UBT Makefiles' for targets when they're built the first time.
- Subsequent builds will load these Makefiles and begin outdatedness checking and build invocation very quickly.
- The caveat is that if source files are added or removed to the project, UBT will need to gather information about those in order for your build to complete successfully.
- Currently, you must run the project file generator after adding/removing source files to tell UBT to re-gather this information.
- Events that can invalidate the 'UBT Makefile':
- Adding/removing .cpp files
- Adding/removing .h files with UObjects
- Adding new UObject types to a file that didn't previously have any
- Changing global build settings (most settings in this file qualify.)
- Changed code that affects how Unreal Header Tool works
- You can force regeneration of the 'UBT Makefile' by passing the '-Gather' argument, or simply regenerating project files
- New command-line parameters added:
- "-Gather": Tells UBT to always perform the gather step (slower but will catch project structural changes)
- "-NoGather": Disables the gather step, unless UBT detects that it must be done. This is the default when bUseExperimentalFastBuildIteration is enabled
- "-GatherOnly": Runs the gather step and saves a UBTMakefile, but doesn't build anything
- "-Assemble": Tells UBT to also assemble build products. This always defaults to enabled
- "-NoAssemble": Tells UBT to skip the assemble step, whether we gathered build products or not
- "-AssembleOnly": Tells UBT to only assemble build products and not to gather, unless UBT determines it must
Other changes:
- UBT now keeps track of which targets it was building in an intermediate file, to help it invalidate cached includes in subsequent runs when the targets are different
- C++ includes are now stored in a class separate from the C++ compile enviroment (for easier serialization)
- The method that UBT uses to find the CoreUObject module timestamp was rewritten
- Various '@todo ubtmake' comments added to tag possible remaining Makefile tasks
- The 'FileItem' class had some member variable comments and code cleaned up, while making it serializable
- Cleaned up the comments and member variables in the "Action" class, while making it serializable
- Some UBT classes are now "serializable". This is because we need to store the data in UBTMakefiles.
- Removed support for Actions to tinker with Stdout and Stderror (was not used for anything)
- Moved PrecompileHeaderEnvironment class to the UEBuildModule.cs source file
- Plugin intermediate include directories are now selected on demand rather than cached early
- Toolchain code for gathering prerequisite headers is now shared in a single function (AddPrerequisiteSourceFile)
- Removed Action.StatusDetailedDescription, was not used for anything
- Removed UEBuildConfiguration.bExcludePlugins, was not used for anything
- Removed ECompilationResult.FailedDueToHeaderChange, was not used for anything
[CL 2254472 by Mike Fricker in Main branch]
2014-08-13 08:17:43 -04:00
/// <summary>
/// Enables a new 'experimental' support for very fast iterative builds. Turning this on causes Unreal Build Tool to emit
/// 'UBT Makefiles' for targets when they're built the first time. Subsequent builds will load these Makefiles and begin
/// outdatedness checking and build invocation very quickly. The caveat is that if source files are added or removed to
/// the project, UBT will need to gather information about those in order for your build to complete successfully. Currently,
/// you must run the project file generator after adding/removing source files to tell UBT to re-gather this information.
/// Events that can invalidate the 'UBT Makefile':
/// - Adding/removing .cpp files
/// - Adding/removing .h files with UObjects
/// - Adding new UObject types to a file that didn't previously have any
/// - Changing global build settings (most settings in this file qualify.)
/// - Changed code that affects how Unreal Header Tool works
/// You can force regeneration of the 'UBT Makefile' by passing the '-gather' argument, or simply regenerating project files
/// </summary>
[XmlConfig]
public static bool bUseExperimentalFastBuildIteration ;
2014-07-31 09:34:11 -04:00
2014-07-31 07:33:17 -04:00
/// <summary>
/// Whether DMUCS/Distcc may be used.
/// </summary>
[XmlConfig]
public static bool bAllowDistcc ;
/// <summary>
/// When enabled allows DMUCS/Distcc to fallback to local compilation when remote compiling fails. Defaults to true as separation of pre-process and compile stages can introduce non-fatal errors.
/// </summary>
[XmlConfig]
public static bool bAllowDistccLocalFallback ;
/// <summary>
/// Path to the Distcc & DMUCS executables.
/// </summary>
[XmlConfig]
public static string DistccExecutablesPath ;
2014-03-14 14:13:41 -04:00
/// <summary>
/// Sets the configuration back to defaults.
/// </summary>
2014-06-05 12:12:32 -04:00
public static void LoadDefaults ( )
2014-03-14 14:13:41 -04:00
{
2014-04-23 18:00:27 -04:00
bAllowLTCG = false ;
bAllowRemotelyCompiledPCHs = false ;
2014-06-05 12:12:32 -04:00
bAllowXGE = true ;
2014-03-14 14:13:41 -04:00
// Don't bother to check external (stable) headers for modification. It slows down UBT's dependency checking.
2014-04-23 18:00:27 -04:00
bCheckExternalHeadersForModification = false ;
bCheckSystemHeadersForModification = false ;
2014-03-14 14:13:41 -04:00
2014-04-23 18:00:27 -04:00
bCopyAppBundleBackToDevice = false ;
bCreateStubIPA = true ;
2014-03-14 14:13:41 -04:00
bDeployAfterCompile = false ;
2014-04-23 18:00:27 -04:00
bDisableDebugInfo = false ;
2014-03-14 14:13:41 -04:00
bEnableCodeAnalysis = false ;
bFlushBuildDirOnRemoteMac = false ;
2014-04-23 18:00:27 -04:00
bGeneratedSYMFile = false ;
bStripSymbolsOnIOS = bGeneratedSYMFile ;
2014-03-14 14:13:41 -04:00
// By default we don't bother relinking targets if only a dependent .lib has changed, as chances are that
// the import library wasn't actually different unless a dependent header file of this target was also changed,
// in which case the target would be rebuilt automatically.
2014-04-23 18:00:27 -04:00
bIgnoreOutdatedImportLibraries = true ;
2014-03-14 14:13:41 -04:00
2014-04-23 18:00:27 -04:00
bLogDetailedActionStats = false ;
bOmitFramePointers = true ;
bOmitPCDebugInfoInDevelopment = false ;
bPrintDebugInfo = false ;
bPrintPerformanceInfo = false ;
bShouldDeleteAllOutdatedProducedItems = false ;
bShowXGEMonitor = false ;
bStopXGECompilationAfterErrors = true ;
bStressTestUnity = false ;
bSupportEditAndContinue = false ;
2014-03-14 14:13:41 -04:00
bUseActionHistory = true ;
// Incremental linking can yield faster iteration times when making small changes
// NOTE: We currently don't use incremental linking because it tends to behave a bit buggy on some computers (PDB-related compile errors)
2014-04-23 18:00:27 -04:00
bUseIncrementalLinking = false ;
2014-03-14 14:13:41 -04:00
bUseMallocProfiler = false ;
2014-04-23 18:00:27 -04:00
bUsePDBFiles = false ;
bUsePCHFiles = true ;
2014-03-14 14:13:41 -04:00
// Shared PCHs are necessary to avoid generating tons of private PCH files for every single little module. While
// these private PCHs do yield fastest incremental compiles for single files, it causes full rebuilds to
// take an inordinate amount of time, and intermediates will use up many gigabytes of disk space.
bUseSharedPCHs = true ;
2014-06-05 12:12:32 -04:00
2014-03-14 14:13:41 -04:00
// Using unity build to coalesce source files allows for much faster full rebuild times. For fastest iteration times on single-file
// changes, consider turning this off. In some cases, unity builds can cause linker errors after iterative changes to files, because
// the synthesized file names for unity code files may change between builds.
2014-04-23 18:00:27 -04:00
bUseUnityBuild = true ;
2014-03-14 14:13:41 -04:00
2014-06-05 12:12:32 -04:00
bForceUnityBuild = false ;
2014-03-14 14:13:41 -04:00
// For programmers working on gameplay code, it's convenient to have fast iteration times when changing only single source
// files. We've set this default such that smaller gameplay modules will not use the unity build feature, allowing them
// the fastest possible iterative compile times at the expense of slower full rebuild times. For larger game modules, unity
// build will automatically be activated.
MinGameModuleSourceFilesForUnityBuild = 32 ;
// This controls how big unity files are. Use smaller values for faster iterative iteration times at the cost of slower full rebuild times.
// This setting can greatly affect how effective parallelized compilation can be.
2014-07-16 12:12:58 -04:00
NumIncludedBytesPerUnityCPP = 384 * 1024 ;
2014-03-14 14:13:41 -04:00
// This sets the number of source files (post-unity-combine) in a module before we'll bother to generate a precompiled header
// for that module. If you want the fastest iterative builds for non-header changes (at the expense of slower full rebuild times),
// set this to value to 1
MinFilesUsingPrecompiledHeader = 6 ;
// We want iterative changes to gameplay modules to be very fast! This makes full rebuilds for small game projects a bit slower,
// but changes to individual code files will compile quickly.
bForcePrecompiledHeaderForGameModules = true ;
// When using the local executor (not XGE), run a single action on each CPU core. Note that you can set this to a larger value
// to get slightly faster build times in many cases, but your computer's responsiveness during compiling may be much worse.
2014-04-23 18:00:27 -04:00
ProcessorCountMultiplier = 1.0 ;
2014-03-14 14:13:41 -04:00
2014-09-25 08:10:40 -04:00
MaxProcessorCount = int . MaxValue ;
2014-03-14 14:13:41 -04:00
bTestIncludeDependencyResolveCache = false ;
// if we are testing the resolve cache, we require UBT to use it.
2014-04-23 18:00:27 -04:00
bUseIncludeDependencyResolveCache = true ;
2014-06-05 12:12:32 -04:00
2014-03-14 14:13:41 -04:00
//IMPORTANT THIS IS THE MAIN SWITCH FOR MONO FAST CALLS
// if this is set to true, then fast calls will be on by default on Dingo, and if false it will be off by default on Dingo.
// This can be overridden by -fastmonocalls or -nofastmonocalls in the NMAKE params.
2014-06-30 07:04:35 -04:00
bUseFastMonoCalls = false ;
2014-03-14 14:13:41 -04:00
// By default we use the Release C++ Runtime (CRT), even when compiling Debug builds. This is because the Debug C++
// Runtime isn't very 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.
bDebugBuildsActuallyUseDebugCRT = false ;
// set up some paths
BaseIntermediateFolder = "Intermediate/Build/" ;
2014-07-21 04:28:22 -04:00
2014-07-21 15:05:48 -04:00
// By default check and stop the build on EULA violation
2014-07-23 09:34:56 -04:00
bCheckLicenseViolations = false ;
2014-07-21 04:28:22 -04:00
bBreakBuildOnLicenseViolation = true ;
2014-07-31 07:33:17 -04:00
Experimental UnrealBuildTool makefile support
UnrealBuildTool 'Makefiles' allow for very fast iterative builds.
- New BuildConfiguration.xml setting added: "bUseExperimentalFastBuildIteration" (disabled by default)
- Turning this on causes Unreal Build Tool to emit 'UBT Makefiles' for targets when they're built the first time.
- Subsequent builds will load these Makefiles and begin outdatedness checking and build invocation very quickly.
- The caveat is that if source files are added or removed to the project, UBT will need to gather information about those in order for your build to complete successfully.
- Currently, you must run the project file generator after adding/removing source files to tell UBT to re-gather this information.
- Events that can invalidate the 'UBT Makefile':
- Adding/removing .cpp files
- Adding/removing .h files with UObjects
- Adding new UObject types to a file that didn't previously have any
- Changing global build settings (most settings in this file qualify.)
- Changed code that affects how Unreal Header Tool works
- You can force regeneration of the 'UBT Makefile' by passing the '-Gather' argument, or simply regenerating project files
- New command-line parameters added:
- "-Gather": Tells UBT to always perform the gather step (slower but will catch project structural changes)
- "-NoGather": Disables the gather step, unless UBT detects that it must be done. This is the default when bUseExperimentalFastBuildIteration is enabled
- "-GatherOnly": Runs the gather step and saves a UBTMakefile, but doesn't build anything
- "-Assemble": Tells UBT to also assemble build products. This always defaults to enabled
- "-NoAssemble": Tells UBT to skip the assemble step, whether we gathered build products or not
- "-AssembleOnly": Tells UBT to only assemble build products and not to gather, unless UBT determines it must
Other changes:
- UBT now keeps track of which targets it was building in an intermediate file, to help it invalidate cached includes in subsequent runs when the targets are different
- C++ includes are now stored in a class separate from the C++ compile enviroment (for easier serialization)
- The method that UBT uses to find the CoreUObject module timestamp was rewritten
- Various '@todo ubtmake' comments added to tag possible remaining Makefile tasks
- The 'FileItem' class had some member variable comments and code cleaned up, while making it serializable
- Cleaned up the comments and member variables in the "Action" class, while making it serializable
- Some UBT classes are now "serializable". This is because we need to store the data in UBTMakefiles.
- Removed support for Actions to tinker with Stdout and Stderror (was not used for anything)
- Moved PrecompileHeaderEnvironment class to the UEBuildModule.cs source file
- Plugin intermediate include directories are now selected on demand rather than cached early
- Toolchain code for gathering prerequisite headers is now shared in a single function (AddPrerequisiteSourceFile)
- Removed Action.StatusDetailedDescription, was not used for anything
- Removed UEBuildConfiguration.bExcludePlugins, was not used for anything
- Removed ECompilationResult.FailedDueToHeaderChange, was not used for anything
[CL 2254472 by Mike Fricker in Main branch]
2014-08-13 08:17:43 -04:00
// This feature reduces the time spent tracking C++ header dependencies every run. This feature is still being tested,
// so we disable it by default
2014-07-31 09:34:11 -04:00
bUseExperimentalFastDependencyScan = false ;
Experimental UnrealBuildTool makefile support
UnrealBuildTool 'Makefiles' allow for very fast iterative builds.
- New BuildConfiguration.xml setting added: "bUseExperimentalFastBuildIteration" (disabled by default)
- Turning this on causes Unreal Build Tool to emit 'UBT Makefiles' for targets when they're built the first time.
- Subsequent builds will load these Makefiles and begin outdatedness checking and build invocation very quickly.
- The caveat is that if source files are added or removed to the project, UBT will need to gather information about those in order for your build to complete successfully.
- Currently, you must run the project file generator after adding/removing source files to tell UBT to re-gather this information.
- Events that can invalidate the 'UBT Makefile':
- Adding/removing .cpp files
- Adding/removing .h files with UObjects
- Adding new UObject types to a file that didn't previously have any
- Changing global build settings (most settings in this file qualify.)
- Changed code that affects how Unreal Header Tool works
- You can force regeneration of the 'UBT Makefile' by passing the '-Gather' argument, or simply regenerating project files
- New command-line parameters added:
- "-Gather": Tells UBT to always perform the gather step (slower but will catch project structural changes)
- "-NoGather": Disables the gather step, unless UBT detects that it must be done. This is the default when bUseExperimentalFastBuildIteration is enabled
- "-GatherOnly": Runs the gather step and saves a UBTMakefile, but doesn't build anything
- "-Assemble": Tells UBT to also assemble build products. This always defaults to enabled
- "-NoAssemble": Tells UBT to skip the assemble step, whether we gathered build products or not
- "-AssembleOnly": Tells UBT to only assemble build products and not to gather, unless UBT determines it must
Other changes:
- UBT now keeps track of which targets it was building in an intermediate file, to help it invalidate cached includes in subsequent runs when the targets are different
- C++ includes are now stored in a class separate from the C++ compile enviroment (for easier serialization)
- The method that UBT uses to find the CoreUObject module timestamp was rewritten
- Various '@todo ubtmake' comments added to tag possible remaining Makefile tasks
- The 'FileItem' class had some member variable comments and code cleaned up, while making it serializable
- Cleaned up the comments and member variables in the "Action" class, while making it serializable
- Some UBT classes are now "serializable". This is because we need to store the data in UBTMakefiles.
- Removed support for Actions to tinker with Stdout and Stderror (was not used for anything)
- Moved PrecompileHeaderEnvironment class to the UEBuildModule.cs source file
- Plugin intermediate include directories are now selected on demand rather than cached early
- Toolchain code for gathering prerequisite headers is now shared in a single function (AddPrerequisiteSourceFile)
- Removed Action.StatusDetailedDescription, was not used for anything
- Removed UEBuildConfiguration.bExcludePlugins, was not used for anything
- Removed ECompilationResult.FailedDueToHeaderChange, was not used for anything
[CL 2254472 by Mike Fricker in Main branch]
2014-08-13 08:17:43 -04:00
// Experimental support for 'gathering' and 'assembling' builds in separate invocations is still being tested, so we
// leave it disabled by default
bUseExperimentalFastBuildIteration = false ;
2014-07-31 07:33:17 -04:00
// Distcc requires some setup - so by default disable it so we don't break local or remote building
bAllowDistcc = false ;
bAllowDistccLocalFallback = true ;
// The normal Posix place to install distcc/dmucs would be /usr/local so start there
DistccExecutablesPath = "/usr/local/bin" ;
// The default for normal Mac users should be to use DistCode which installs as an Xcode plugin and provides dynamic host management
2014-08-06 07:05:15 -04:00
if ( BuildHostPlatform . Current . Platform = = UnrealTargetPlatform . Mac )
2014-07-31 07:33:17 -04:00
{
string UserDir = Environment . GetEnvironmentVariable ( "HOME" ) ;
string MacDistccExecutablesPath = UserDir + "/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Distcc 3.2.xcplugin/Contents/usr/bin" ;
// But we should use the standard Posix directory when not installed - a build farm would use a static .dmucs hosts file not DistCode.
if ( System . IO . Directory . Exists ( MacDistccExecutablesPath ) )
{
DistccExecutablesPath = MacDistccExecutablesPath ;
}
}
2014-03-14 14:13:41 -04:00
}
/// <summary>
/// Validates the configuration. E.g. some options are mutually exclusive whereof some imply others. Also
/// some functionality is not available on all platforms.
/// @warning: the order of validation is important
/// </summary>
/// <param name="Configuration">Current configuration (e.g. development, debug, ...)</param>
/// <param name="Platform">Current platform (e.g. Win32, PS3, ...)</param>
/// <param name="bCreateDebugInfo">True if debug info should be created</param>
public static void ValidateConfiguration ( CPPTargetConfiguration Configuration , CPPTargetPlatform Platform , bool bCreateDebugInfo )
{
2014-05-21 06:09:37 -04:00
var BuildPlatform = UEBuildPlatform . GetBuildPlatformForCPPTargetPlatform ( Platform ) ;
2014-03-14 14:13:41 -04:00
// E&C support.
if ( bSupportEditAndContinue )
{
bUseIncrementalLinking = BuildPlatform . ShouldUseIncrementalLinking ( Platform , Configuration ) ;
}
// Incremental linking.
if ( bUseIncrementalLinking )
{
bUsePDBFiles = BuildPlatform . ShouldUsePDBFiles ( Platform , Configuration , bCreateDebugInfo ) ;
}
// Detailed stats
2014-04-02 18:09:23 -04:00
if ( bLogDetailedActionStats & & bAllowXGE )
2014-03-14 14:13:41 -04:00
{
2014-04-02 18:09:23 -04:00
// Some build machines apparently have this turned on, so if you really want detailed stats, don't run with XGE
bLogDetailedActionStats = false ;
2014-03-14 14:13:41 -04:00
}
if ( UnrealBuildTool . RunningRocket ( ) )
{
bAllowXGE = false ;
}
// PDB
if ( bUsePDBFiles )
{
// NOTE: Currently we allow XGE to run, even with PDBs, until we notice an issue with this
bool bDisallowXGEWithPDBFiles = false ;
if ( bDisallowXGEWithPDBFiles )
{
// Force local execution as we have one PDB for all files using the same PCH. This currently doesn't
// scale well with XGE due to required networking bandwidth. Xoreax mentioned that this was going to
// be fixed in a future version of the software.
bAllowXGE = false ;
}
}
// Allow for the build platform to perform custom validation here...
// NOTE: This CAN modify the static BuildConfiguration settings!!!!
BuildPlatform . ValidateBuildConfiguration ( Configuration , Platform , bCreateDebugInfo ) ;
if ( ! BuildPlatform . CanUseXGE ( ) )
{
bAllowXGE = false ;
}
2014-07-31 07:33:17 -04:00
if ( ! BuildPlatform . CanUseDistcc ( ) )
{
bAllowDistcc = false ;
}
2014-03-14 14:13:41 -04:00
}
}
}