You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#lockdown Nick.Penwarden
==========================
MAJOR FEATURES + CHANGES
==========================
Change 3284872 on 2017/02/03 by Graeme.Thornton
Seperate pak cache granularity from pak signing chunk size
Change 3285765 on 2017/02/03 by Graeme.Thornton
Fix stats warnings because each slate new loading screen thread has the same stat name, but is assigned to a different thread
#jira UE-41478
Change 3286913 on 2017/02/04 by Ben.Marsh
IncludeTool: Merging fixes.
* Don't remove existing forward declarations unless explicitly instructed to do so. Files are optimized with these declarations in place, so removing them can cause output files to fail to build. It can be a useful separate step though, so expose it as a command-line option instead.
* Add a specific option for which files should be output by the tool. Any files which are excluded from this list are treated specially when generating output files, so as to prevent them from causing files to be omitted from other files that include them. Also add an option to force this mode for all headers, for use when testing formatting/include path generation.
Change 3287100 on 2017/02/05 by Ben.Marsh
UBT: Move platform settings into platform-specific TargetRules objects.
Change 3287106 on 2017/02/05 by Ben.Marsh
Merge UEBuildPlatformContext into UEBuildPlatform. Now that targets can have platform-specific settings, there is no need to separate a platform class which contains target-specific information.
Change 3287398 on 2017/02/06 by Steve.Robb
Fix for UHT failing when -WarningsAsErrors and -Verbose are specified together.
Change 3287399 on 2017/02/06 by Steve.Robb
Log verbosities made more readable in the debugger.
Change 3287410 on 2017/02/06 by Steve.Robb
Fix for TStructOpsTypeTraits where WithCopy gives a different result between specializing the traits and not providing WithCopy and not specializing the traits at all.
#fyi marc.audy
Change 3288020 on 2017/02/06 by Ben.Marsh
Prevent forward declaration of the ITextData class. We need to include the header for the debugger visualizers to work correctly.
Change 3291817 on 2017/02/08 by Steve.Robb
New EBlueprintCompileReinstancerFlags used to construct FBlueprintCompileReinstancer, instead of lots of bools.
Change 3292090 on 2017/02/08 by Graeme.Thornton
Crash fix - don't update font engine services if it was never created
#jira UE-33953
Change 3292993 on 2017/02/08 by Ben.Marsh
Add an option to disable force-including PCHs for files in the non-unity working set. (bAdaptiveUnityDisablesPCH)
Change 3293231 on 2017/02/08 by Ben.Marsh
BuildGraph: Allow overriding the changelist that a badge should be displayed for (with the Change="" attribute on the Badge declaration in XML), so the code changelist can be used if necessary. Also link to the failed step if only one has failed.
Change 3294213 on 2017/02/09 by Ben.Marsh
EC: Allow setting a property on frequent CI jobs that allows us to exclude it from job searches for generating the dashboard. Filtering on the client side is causing dashboard pages to be almost empty.
Change 3294753 on 2017/02/09 by Ben.Zeigler
#jira UE-41151 Fix UObjectLibrary::RemoveObject to remove from the correct array, and add comment mentioning that the dynamic use of Object Library is semi-deprecated
Change 3296070 on 2017/02/09 by Ben.Zeigler
Explicitly turn off Copy for a struct that has a linked list internally. I think turning Copy on by default for all non POD Types is pretty risky and is likely to crash for other games. In this case it was being copied for network replication, and it didn't have one defined so the default C++ one copied the linked list and crashed on destruction.
Change 3296420 on 2017/02/10 by Graeme.Thornton
Remove remaining references to AES_KEY, instead using the encryption key delegates to access the key where needed
Refactored encryption and signing key access in unrealpak to make it easier to use
Change 3296609 on 2017/02/10 by Ben.Marsh
BuildGraph: Fix error running the <Copy> task with an empty "From" argument.
* FileSystemReference.IsUnderDirectory() was not correctly handling cases where the directory was a root directory (and has to end in a path separator)
* FilePattern.AsDirectoryReference() with an empty token would append a path separator to an empty string, resulting in it referencing the root directory rather than the given base directory.
Change 3297440 on 2017/02/10 by Ben.Marsh
UBT: Move the FileFilter class into UnrealBuildTool.
Change 3297725 on 2017/02/10 by Ben.Zeigler
#jira UE-39199 Fix issue with enum value redirects using the wrong short or long name, it now fully supports both.
Clean up a lot of confusingly named and broken functions on UEnum:
#jira UE-41348 Deprecate FindEnumIndex, GetEnum, GetEnumName, replace with GetIndexByName, GetNameByIndex, and GetNameStringByIndex and clean up warnings
#jira UE-38187 Deprecate GetDisplayNameText and GetEnumText, replaced both with GetDisplayNameTextAtIndex which is now callable outside the editor and has a better comment
Deprecate FindEnumRedirects and replace with GetIndexByNameString. Fix code to not check the redirects array 5 times per enum lookup
Fix GetValueAsString to actually act on a value, not an index. This matches common usage and the function's name
While fixing deprecation warnings on internal games, fixed dozens of cases where it was using Index functions when it should have been using Value functions
Delete some now redundant enum editor code and pipe everything through UEnum
Change 3297979 on 2017/02/10 by Ben.Zeigler
Fix issues parsing Enums that are literally the string "None", which is allowed but leads to some odd behavior
Change 3298299 on 2017/02/10 by Steve.Robb
TTuple improvements:
- equality comparable
- serializable
- in the correct folder
2-tuples are specialized to be syntactically compatible with both TPair and TTuple.
TPair is now an alias for a 2-tuple and is no longer bound to TPairInitializer.
#fyi robert.manuszewski,ben.marsh
Change 3298460 on 2017/02/11 by Ben.Marsh
UGS: Set the correct result from running custom tasks.
Change 3298462 on 2017/02/11 by Ben.Marsh
UBT: Fix some deprecated messages that have the wrong release version, and add a better message for how ModuleRules constructors need to be updated.
Change 3299447 on 2017/02/13 by Graeme.Thornton
Fix AES and pak signing key embedding for content only projects
- Force temp target when any keys are specified by project config
Change 3299649 on 2017/02/13 by Steve.Robb
PLATFORM_HAS_DEFAULTED_OPERATORS fixed.
Other obsolete compiler switches removed.
Change 3299787 on 2017/02/13 by Steve.Robb
IsAbstract() for testing if a reflected native type contains pure virtual functions. Needed for BP nativization.
#fyi robert.manuszewski
Change 3300576 on 2017/02/13 by Ben.Marsh
EC: Add support for starting builds on any agent type. Mapping from agent types to resource pools is stored in an EC property sheet (/Generated/<Stream>/AgentTypes), allowing EC procedures to map it to a resource pool from a parameter.
Change 3300600 on 2017/02/13 by Ben.Marsh
EC: Add the -ClearHistory argument to UAT run to export BuildGraph settings, to allow running on incremental workspaces.
Change 3300624 on 2017/02/13 by Ben.Marsh
Switch incremental builds for all streams to start up on the incremental agent.
Change 3302134 on 2017/02/14 by Steve.Robb
UnrealCodeAnalyzer removed.
#fyi ben.marsh,robert.manuszewski
Change 3302639 on 2017/02/14 by Ben.Zeigler
Fix crash cooking odin with default command line
#jira UE-41952 Delete StealthTeleport map that crashes on load, and update default cook list that gets used if nothing specified
Change 3303002 on 2017/02/14 by Ben.Zeigler
#jira UE-41061 Fix it so editor only filtering on savepackage is uniformly applied regardless of if it's at package or object level
#jira UE-41880 Rewrite editor/client/server only filtering logic in SavePackage to fix various bugs. It now does all of the filtering up front, and won't process any filtered objects for imports or exports
Rename NotForEditorGame to NotAlwaysLoadedForEditorGame and improve comments, this flag says that the asset should be loaded EVEN IF it is editor only, it does not affect loading for normal objects
Change the non-map cook flags to RF_Public instead of RF_Standalone. Blueprint classes aren't RF_Standalone so were only being cooked before due to an accident of the dependency checker
Change it so anything with a Transient outer is marked transient at save time. These objects would not save out properly anyway
Fix it so -cooksinglepackage works properly again and excludes localization and startup packages
Tested with Fortnite and Odin, Odin works but with lots of warnings with nativization on which I need to investigate
Change 3303084 on 2017/02/14 by Ben.Zeigler
Attempt to get Nativization and EDL working without warnings
Change 3305153 on 2017/02/15 by Ben.Zeigler
Fix Fortnite and Orion cook, I don't understand why this passed my local testing
Fix the CDO subobject finder to actually return things instead of doing nothing, and fix a shadow variable warning
Change 3305959 on 2017/02/16 by Gil.Gribb
UE4 - Tweaked out the EDL loader for the switch with benefits to all platforms.
Change 3306159 on 2017/02/16 by Ben.Marsh
Fix path to target binaries when building non-monolithic in a unique build environment.
Change 3306584 on 2017/02/16 by Steve.Robb
UEnum internal functions renamed from Index to Value.
GetValueAsString_Internal() parameter now takes an int64, as is expected for enum values.
#fyi ben.zeigler
Change 3307836 on 2017/02/16 by Ben.Zeigler
#jira UE-42055 Load very old redirects in cooked builds. Matinee has no way of resaving redirects, so as long as matinee exists we need to keep them around forever, or fix matinee manually
Fixes lighting in Infiltrator demo
Change 3307929 on 2017/02/16 by Ben.Zeigler
#jira UE-42055 Second half of matinee redirector fix
Change 3308840 on 2017/02/17 by Matthew.Griffin
Reimplementing CL#3305808 from 4.15
Changed QA label build process so that it only allows version with 3 components (we always add the .0 for initial releases)
Change 3309115 on 2017/02/17 by Ben.Marsh
Windows: Fix the GetModulesDirectory() function always returning the engine binaries directory. It's possible to build non-monolithic targets which output all engine binaries to the game binaries directory - a requirement to being able to set game-specific defines or build settings, because we don't want shared engine binaries to be tainted with them. The module manager needs to be able to operate early on, before many of the game settings have been initialized, so just return the directory containing the Core module instead.
Change 3309120 on 2017/02/17 by Ben.Marsh
Fix support for creating modular builds which don't use the shared build environment.
Change 3309125 on 2017/02/17 by Ben.Marsh
Require that -CookDir arguments are specified separately on the command line. '+' is a valid path character (and common in build versions), so we shouldn't treat it as an argument separator.
Change 3309128 on 2017/02/17 by Ben.Marsh
Fix UnrealPak failures when enumerating all files from a source directory, if that directory happens to contain spaces.
Change 3309131 on 2017/02/17 by Ben.Marsh
Fix list of discovered assets being cleared by second call to FindFilesRecursive() when building DDC. Disable the -cookdir parameter again.
Change 3309140 on 2017/02/17 by Ben.Marsh
UAT: Fix exception moving a file from one location to another if the target directory does not exist.
Change 3309212 on 2017/02/17 by Ben.Marsh
Fixes/improvements for mod editor and code mods:
* A separate top-level project is generated for each code mod in the Visual Studio solution.
* Plugin descriptors now have a flag to identify themselves as mod as opposed to a regular game plugin, which prevents project plugins from getting their own VS project. New mods created with the mod editor will have this set by default, as do the three existing sample mods.
* Cleaning and building code mods will never modify engine binaries. Presence of the Engine/Build/InstalledProjectBuild.txt file is used to indicate running in this environment. This flag also disables options to edit metadata for non-mod plugins in installed builds.
* Plugin browser now includes a separate category for mods.
* Mod editor now behaves as an "installed" program by default, and will use the user's home folder for storing settings.
Change 3309231 on 2017/02/17 by Steve.Robb
Fix for Ar << bSomeBool where Ar is a derived class which overrides an operator<<.
#jira UE-42052
Change 3309248 on 2017/02/17 by Ben.Marsh
Add support for hot-reloading game plugin modules from Visual Studio, as long as their module returns IsGameModule() = true.
Change 3309257 on 2017/02/17 by Ben.Marsh
Prevent game binaries from being renamed for hot reload when working with installed projects.
Change 3309355 on 2017/02/17 by Steven.Hutton
Changes to make the website compatible with the new database changes.
Change 3309371 on 2017/02/17 by Ben.Marsh
Fix exception on shutdown when running asset registry with threads disabled.
#jira UE-41951
Change 3309389 on 2017/02/17 by Ben.Zeigler
#jira UE-42051 Fix ensure and crash when loading a null asset ID via the LoadAsset BP node
Change 3309570 on 2017/02/17 by Gil.Gribb
UE4 - Switch load time performace tweaks, plus abstracted the IO tracker and handle manager for other platforms and applied it to the PS4.
Change 3310039 on 2017/02/17 by Ben.Marsh
BuildGraph: Prevent exception when trying to delete a file that does not exist.
Change 3311484 on 2017/02/20 by Chris.Wood
CrashReportProcess crash add retry logic improvements (CRP v1.2.16)
Change 3311600 on 2017/02/20 by Matthew.Griffin
Updated StripSymbols functions so that all platforms can deal with the source and target file being the same
Change 3311675 on 2017/02/20 by Steve.Robb
FNativeClassHeaderGenerator::CurrentSourceFile stack replaced with C++ stack.
Change 3311893 on 2017/02/20 by Ben.Marsh
UGS: Add support for notifying users if CIS steps fail for content changes. Badges which test content should be listed in the [Notifications] section of the project-specific INI file, through +ContentBadges= lines.
Change 3313966 on 2017/02/21 by Ben.Marsh
Fix EC parsing of error messages output by the editor in the form "LogXYZ:Error:". Greedy optional subexpression in regex was matching everything until a space, so terminate a colon too.
Change 3314398 on 2017/02/21 by Ben.Zeigler
#jira UE-42212 Fix shutdown of AnimGraph module to be safer
[CL 3315211 by Ben Marsh in Main branch]
718 lines
26 KiB
C#
718 lines
26 KiB
C#
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using System.Diagnostics;
|
|
using System.IO;
|
|
using System.Linq;
|
|
|
|
namespace UnrealBuildTool
|
|
{
|
|
abstract class UEBuildPlatform
|
|
{
|
|
private static Dictionary<UnrealTargetPlatform, UEBuildPlatform> BuildPlatformDictionary = new Dictionary<UnrealTargetPlatform, UEBuildPlatform>();
|
|
|
|
// a mapping of a group to the platforms in the group (ie, Microsoft contains Win32 and Win64)
|
|
static Dictionary<UnrealPlatformGroup, List<UnrealTargetPlatform>> PlatformGroupDictionary = new Dictionary<UnrealPlatformGroup, List<UnrealTargetPlatform>>();
|
|
|
|
/// <summary>
|
|
/// The corresponding target platform enum
|
|
/// </summary>
|
|
public readonly UnrealTargetPlatform Platform;
|
|
|
|
/// <summary>
|
|
/// The default C++ target platform to use
|
|
/// </summary>
|
|
public readonly CppPlatform DefaultCppPlatform;
|
|
|
|
/// <summary>
|
|
/// Cached copy of the list of folders to exclude for this platform
|
|
/// </summary>
|
|
private FileSystemName[] CachedExcludedFolderNames;
|
|
|
|
/// <summary>
|
|
/// List of all confidential folder names
|
|
/// </summary>
|
|
public static readonly string[] RestrictedFolderNames =
|
|
{
|
|
"EpicInternal",
|
|
"CarefullyRedist",
|
|
"NotForLicensees",
|
|
"NoRedist",
|
|
"PS4",
|
|
"XboxOne",
|
|
"Switch",
|
|
"Wolf",
|
|
"WolfPlat",
|
|
};
|
|
|
|
/// <summary>
|
|
/// Constructor.
|
|
/// </summary>
|
|
/// <param name="InPlatform">The enum value for this platform</param>
|
|
/// <param name="InDefaultCPPPlatform">The default C++ platform for this platform</param>
|
|
public UEBuildPlatform(UnrealTargetPlatform InPlatform, CppPlatform InDefaultCPPPlatform)
|
|
{
|
|
Platform = InPlatform;
|
|
DefaultCppPlatform = InDefaultCPPPlatform;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Finds a list of folder names to exclude when building for this platform
|
|
/// </summary>
|
|
public FileSystemName[] GetExcludedFolderNames()
|
|
{
|
|
if(CachedExcludedFolderNames == null)
|
|
{
|
|
// Find all the platform folders to exclude from the list of precompiled modules
|
|
List<FileSystemName> Names = new List<FileSystemName>();
|
|
foreach (UnrealTargetPlatform TargetPlatform in Enum.GetValues(typeof(UnrealTargetPlatform)))
|
|
{
|
|
if (TargetPlatform != UnrealTargetPlatform.Unknown && TargetPlatform != Platform)
|
|
{
|
|
Names.Add(new FileSystemName(TargetPlatform.ToString()));
|
|
}
|
|
}
|
|
|
|
// Also exclude all the platform groups that this platform is not a part of
|
|
List<UnrealPlatformGroup> IncludePlatformGroups = new List<UnrealPlatformGroup>(UEBuildPlatform.GetPlatformGroups(Platform));
|
|
foreach (UnrealPlatformGroup PlatformGroup in Enum.GetValues(typeof(UnrealPlatformGroup)))
|
|
{
|
|
if (!IncludePlatformGroups.Contains(PlatformGroup))
|
|
{
|
|
Names.Add(new FileSystemName(PlatformGroup.ToString()));
|
|
}
|
|
}
|
|
|
|
// Save off the list as an array
|
|
CachedExcludedFolderNames = Names.ToArray();
|
|
}
|
|
return CachedExcludedFolderNames;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Whether the required external SDKs are installed for this platform. Could be either a manual install or an AutoSDK.
|
|
/// </summary>
|
|
public abstract SDKStatus HasRequiredSDKsInstalled();
|
|
|
|
/// <summary>
|
|
/// Gets all the registered platforms
|
|
/// </summary>
|
|
/// <returns>Sequence of registered platforms</returns>
|
|
public static IEnumerable<UnrealTargetPlatform> GetRegisteredPlatforms()
|
|
{
|
|
return BuildPlatformDictionary.Keys;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Get the default architecture for a project. This may be overriden on the command line to UBT.
|
|
/// </summary>
|
|
/// <param name="ProjectFile">Optional project to read settings from </param>
|
|
public virtual string GetDefaultArchitecture(FileReference ProjectFile)
|
|
{
|
|
// by default, use an empty architecture (which is really just a modifer to the platform for some paths/names)
|
|
return "";
|
|
}
|
|
|
|
/// <summary>
|
|
/// Get name for architecture-specific directories (can be shorter than architecture name itself)
|
|
/// </summary>
|
|
public virtual string GetFolderNameForArchitecture(string Architecture)
|
|
{
|
|
// by default, use the architecture name
|
|
return Architecture;
|
|
}
|
|
|
|
public virtual void PreBuildSync()
|
|
{
|
|
}
|
|
|
|
public virtual void PostBuildSync(UEBuildTarget Target)
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Called immediately after UnrealHeaderTool is executed to generated code for all UObjects modules. Only is called if UnrealHeaderTool was actually run in this session.
|
|
/// </summary>
|
|
/// <param name="Manifest">List of UObject modules we generated code for.</param>
|
|
public virtual void PostCodeGeneration(UHTManifest Manifest)
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts the passed in path from UBT host to compiler native format.
|
|
/// </summary>
|
|
/// <param name="OriginalPath">The path to convert</param>
|
|
/// <returns>The path in native format for the toolchain</returns>
|
|
public virtual string ConvertPath(string OriginalPath)
|
|
{
|
|
return OriginalPath;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Attempt to convert a string to an UnrealTargetPlatform enum entry
|
|
/// </summary>
|
|
/// <returns>UnrealTargetPlatform.Unknown on failure (the platform didn't match the enum)</returns>
|
|
public static UnrealTargetPlatform ConvertStringToPlatform(string InPlatformName)
|
|
{
|
|
// special case x64, to not break anything
|
|
// @todo: Is it possible to remove this hack?
|
|
if (InPlatformName.Equals("X64", StringComparison.InvariantCultureIgnoreCase))
|
|
{
|
|
return UnrealTargetPlatform.Win64;
|
|
}
|
|
|
|
// we can't parse the string into an enum because Enum.Parse is case sensitive, so we loop over the enum
|
|
// looking for matches
|
|
foreach (string PlatformName in Enum.GetNames(typeof(UnrealTargetPlatform)))
|
|
{
|
|
if (InPlatformName.Equals(PlatformName, StringComparison.InvariantCultureIgnoreCase))
|
|
{
|
|
// convert the known good enum string back to the enum value
|
|
return (UnrealTargetPlatform)Enum.Parse(typeof(UnrealTargetPlatform), PlatformName);
|
|
}
|
|
}
|
|
return UnrealTargetPlatform.Unknown;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Determines whether a given platform is available
|
|
/// </summary>
|
|
/// <param name="Platform">The platform to check for</param>
|
|
/// <returns>True if it's available, false otherwise</returns>
|
|
public static bool IsPlatformAvailable(UnrealTargetPlatform Platform)
|
|
{
|
|
return BuildPlatformDictionary.ContainsKey(Platform);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Register the given platforms UEBuildPlatform instance
|
|
/// </summary>
|
|
/// <param name="InBuildPlatform"> The UEBuildPlatform instance to use for the InPlatform</param>
|
|
public static void RegisterBuildPlatform(UEBuildPlatform InBuildPlatform)
|
|
{
|
|
if (BuildPlatformDictionary.ContainsKey(InBuildPlatform.Platform) == true)
|
|
{
|
|
Log.TraceWarning("RegisterBuildPlatform Warning: Registering build platform {0} for {1} when it is already set to {2}",
|
|
InBuildPlatform.ToString(), InBuildPlatform.Platform.ToString(), BuildPlatformDictionary[InBuildPlatform.Platform].ToString());
|
|
BuildPlatformDictionary[InBuildPlatform.Platform] = InBuildPlatform;
|
|
}
|
|
else
|
|
{
|
|
BuildPlatformDictionary.Add(InBuildPlatform.Platform, InBuildPlatform);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Assign a platform as a member of the given group
|
|
/// </summary>
|
|
public static void RegisterPlatformWithGroup(UnrealTargetPlatform InPlatform, UnrealPlatformGroup InGroup)
|
|
{
|
|
// find or add the list of groups for this platform
|
|
List<UnrealTargetPlatform> Platforms;
|
|
if(!PlatformGroupDictionary.TryGetValue(InGroup, out Platforms))
|
|
{
|
|
Platforms = new List<UnrealTargetPlatform>();
|
|
PlatformGroupDictionary.Add(InGroup, Platforms);
|
|
}
|
|
Platforms.Add(InPlatform);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Retrieve the list of platforms in this group (if any)
|
|
/// </summary>
|
|
public static List<UnrealTargetPlatform> GetPlatformsInGroup(UnrealPlatformGroup InGroup)
|
|
{
|
|
List<UnrealTargetPlatform> PlatformList;
|
|
PlatformGroupDictionary.TryGetValue(InGroup, out PlatformList);
|
|
return PlatformList;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Enumerates all the platform groups for a given platform
|
|
/// </summary>
|
|
/// <param name="Platform">The platform to look for</param>
|
|
/// <returns>List of platform groups that this platform is a member of</returns>
|
|
public static IEnumerable<UnrealPlatformGroup> GetPlatformGroups(UnrealTargetPlatform Platform)
|
|
{
|
|
return PlatformGroupDictionary.Where(x => x.Value.Contains(Platform)).Select(x => x.Key);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Retrieve the IUEBuildPlatform instance for the given TargetPlatform
|
|
/// </summary>
|
|
/// <param name="InPlatform"> The UnrealTargetPlatform being built</param>
|
|
/// <param name="bInAllowFailure"> If true, do not throw an exception and return null</param>
|
|
/// <returns>UEBuildPlatform The instance of the build platform</returns>
|
|
public static UEBuildPlatform GetBuildPlatform(UnrealTargetPlatform InPlatform, bool bInAllowFailure = false)
|
|
{
|
|
if (BuildPlatformDictionary.ContainsKey(InPlatform) == true)
|
|
{
|
|
return BuildPlatformDictionary[InPlatform];
|
|
}
|
|
if (bInAllowFailure == true)
|
|
{
|
|
return null;
|
|
}
|
|
throw new BuildException("GetBuildPlatform: No BuildPlatform found for {0}", InPlatform.ToString());
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the UnrealTargetPlatform matching a given CPPTargetPlatform
|
|
/// </summary>
|
|
/// <param name="InCPPPlatform">The compile platform</param>
|
|
/// <returns>The target platform</returns>
|
|
public static UnrealTargetPlatform CPPTargetPlatformToUnrealTargetPlatform(CppPlatform InCPPPlatform)
|
|
{
|
|
switch (InCPPPlatform)
|
|
{
|
|
case CppPlatform.Win32: return UnrealTargetPlatform.Win32;
|
|
case CppPlatform.Win64: return UnrealTargetPlatform.Win64;
|
|
case CppPlatform.Mac: return UnrealTargetPlatform.Mac;
|
|
case CppPlatform.XboxOne: return UnrealTargetPlatform.XboxOne;
|
|
case CppPlatform.PS4: return UnrealTargetPlatform.PS4;
|
|
case CppPlatform.Android: return UnrealTargetPlatform.Android;
|
|
case CppPlatform.IOS: return UnrealTargetPlatform.IOS;
|
|
case CppPlatform.HTML5: return UnrealTargetPlatform.HTML5;
|
|
case CppPlatform.Linux: return UnrealTargetPlatform.Linux;
|
|
case CppPlatform.TVOS: return UnrealTargetPlatform.TVOS;
|
|
case CppPlatform.Switch: return UnrealTargetPlatform.Switch;
|
|
}
|
|
throw new BuildException("CPPTargetPlatformToUnrealTargetPlatform: Unknown CPPTargetPlatform {0}", InCPPPlatform.ToString());
|
|
}
|
|
|
|
/// <summary>
|
|
/// Retrieve the IUEBuildPlatform instance for the given CPPTargetPlatform
|
|
/// </summary>
|
|
/// <param name="InPlatform"> The CPPTargetPlatform being built</param>
|
|
/// <param name="bInAllowFailure"> If true, do not throw an exception and return null</param>
|
|
/// <returns>UEBuildPlatform The instance of the build platform</returns>
|
|
public static UEBuildPlatform GetBuildPlatformForCPPTargetPlatform(CppPlatform InPlatform, bool bInAllowFailure = false)
|
|
{
|
|
UnrealTargetPlatform UTPlatform = CPPTargetPlatformToUnrealTargetPlatform(InPlatform);
|
|
if (BuildPlatformDictionary.ContainsKey(UTPlatform) == true)
|
|
{
|
|
return BuildPlatformDictionary[UTPlatform];
|
|
}
|
|
if (bInAllowFailure == true)
|
|
{
|
|
return null;
|
|
}
|
|
throw new BuildException("UEBuildPlatform::GetBuildPlatformForCPPTargetPlatform: No BuildPlatform found for {0}", InPlatform.ToString());
|
|
}
|
|
|
|
/// <summary>
|
|
/// Allow all registered build platforms to modify the newly created module
|
|
/// passed in for the given platform.
|
|
/// This is not required - but allows for hiding details of a particular platform.
|
|
/// </summary>
|
|
/// <param name="ModuleName">The name of the module</param>
|
|
/// <param name="Rules">The module rules</param>
|
|
/// <param name="Target">The target being build</param>
|
|
public static void PlatformModifyHostModuleRules(string ModuleName, ModuleRules Rules, ReadOnlyTargetRules Target)
|
|
{
|
|
foreach (KeyValuePair<UnrealTargetPlatform, UEBuildPlatform> PlatformEntry in BuildPlatformDictionary)
|
|
{
|
|
PlatformEntry.Value.ModifyModuleRulesForOtherPlatform(ModuleName, Rules, Target);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Returns the delimiter used to separate paths in the PATH environment variable for the platform we are executing on.
|
|
/// </summary>
|
|
public static String GetPathVarDelimiter()
|
|
{
|
|
switch (BuildHostPlatform.Current.Platform)
|
|
{
|
|
case UnrealTargetPlatform.Linux:
|
|
case UnrealTargetPlatform.Mac:
|
|
return ":";
|
|
case UnrealTargetPlatform.Win32:
|
|
case UnrealTargetPlatform.Win64:
|
|
return ";";
|
|
default:
|
|
Log.TraceWarning("PATH var delimiter unknown for platform " + BuildHostPlatform.Current.Platform.ToString() + " using ';'");
|
|
return ";";
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Returns the name that should be returned in the output when doing -validateplatforms
|
|
/// </summary>
|
|
public virtual string GetPlatformValidationName()
|
|
{
|
|
return Platform.ToString();
|
|
}
|
|
|
|
/// <summary>
|
|
/// If this platform can be compiled with XGE
|
|
/// </summary>
|
|
public virtual bool CanUseXGE()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// If this platform can be compiled with DMUCS/Distcc
|
|
/// </summary>
|
|
public virtual bool CanUseDistcc()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// If this platform can be compiled with SN-DBS
|
|
/// </summary>
|
|
public virtual bool CanUseSNDBS()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Set all the platform-specific defaults for a new target
|
|
/// </summary>
|
|
public virtual void ResetTarget(TargetRules Target)
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Validate a target's settings
|
|
/// </summary>
|
|
public virtual void ValidateTarget(TargetRules Target)
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Return whether the given platform requires a monolithic build
|
|
/// </summary>
|
|
/// <param name="InPlatform">The platform of interest</param>
|
|
/// <param name="InConfiguration">The configuration of interest</param>
|
|
/// <returns></returns>
|
|
public static bool PlatformRequiresMonolithicBuilds(UnrealTargetPlatform InPlatform, UnrealTargetConfiguration InConfiguration)
|
|
{
|
|
// Some platforms require monolithic builds...
|
|
UEBuildPlatform BuildPlatform = GetBuildPlatform(InPlatform, true);
|
|
if (BuildPlatform != null)
|
|
{
|
|
return BuildPlatform.ShouldCompileMonolithicBinary(InPlatform);
|
|
}
|
|
|
|
// We assume it does not
|
|
return false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Get the extension to use for the given binary type
|
|
/// </summary>
|
|
/// <param name="InBinaryType"> The binary type being built</param>
|
|
/// <returns>string The binary extension (i.e. 'exe' or 'dll')</returns>
|
|
public virtual string GetBinaryExtension(UEBuildBinaryType InBinaryType)
|
|
{
|
|
throw new BuildException("GetBinaryExtensiton for {0} not handled in {1}", InBinaryType.ToString(), this.ToString());
|
|
}
|
|
|
|
/// <summary>
|
|
/// Get the extension to use for debug info for the given binary type
|
|
/// </summary>
|
|
/// <param name="InTarget">Options for the target being built</param>
|
|
/// <param name="InBinaryType"> The binary type being built</param>
|
|
/// <returns>string The debug info extension (i.e. 'pdb')</returns>
|
|
public virtual string GetDebugInfoExtension(ReadOnlyTargetRules InTarget, UEBuildBinaryType InBinaryType)
|
|
{
|
|
throw new BuildException("GetDebugInfoExtension for {0} not handled in {1}", InBinaryType.ToString(), this.ToString());
|
|
}
|
|
|
|
/// <summary>
|
|
/// Whether the editor should be built for this platform or not
|
|
/// </summary>
|
|
/// <param name="InPlatform"> The UnrealTargetPlatform being built</param>
|
|
/// <param name="InConfiguration">The UnrealTargetConfiguration being built</param>
|
|
/// <returns>bool true if the editor should be built, false if not</returns>
|
|
public virtual bool ShouldNotBuildEditor(UnrealTargetPlatform InPlatform, UnrealTargetConfiguration InConfiguration)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Whether this build should support ONLY cooked data or not
|
|
/// </summary>
|
|
/// <param name="InPlatform"> The UnrealTargetPlatform being built</param>
|
|
/// <param name="InConfiguration">The UnrealTargetConfiguration being built</param>
|
|
/// <returns>bool true if the editor should be built, false if not</returns>
|
|
public virtual bool BuildRequiresCookedData(UnrealTargetPlatform InPlatform, UnrealTargetConfiguration InConfiguration)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Whether this platform requires the use of absolute paths in Unity files. The compiler will try to combine paths in
|
|
/// each #include directive with the standard include paths, and unity files in intermediate directories can result in the
|
|
/// maximum path length being exceeded on Windows. On the other hand, remote compilation requires relative paths so
|
|
/// dependency checking works correctly on the local machine as well as on the remote machine.
|
|
/// </summary>
|
|
/// <returns>bool true if it is required, false if not</returns>
|
|
public virtual bool UseAbsolutePathsInUnityFiles()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Whether this platform should build a monolithic binary
|
|
/// </summary>
|
|
public virtual bool ShouldCompileMonolithicBinary(UnrealTargetPlatform InPlatform)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Modify the rules for a newly created module, where the target is a different host platform.
|
|
/// This is not required - but allows for hiding details of a particular platform.
|
|
/// </summary>
|
|
/// <param name="ModuleName">The name of the module</param>
|
|
/// <param name="Rules">The module rules</param>
|
|
/// <param name="Target">The target being build</param>
|
|
public virtual void ModifyModuleRulesForOtherPlatform(string ModuleName, ModuleRules Rules, ReadOnlyTargetRules Target)
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Allow the platform to override the NMake output name
|
|
/// </summary>
|
|
public virtual FileReference ModifyNMakeOutput(FileReference ExeName)
|
|
{
|
|
// by default, use original
|
|
return ExeName;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Allows the platform to override whether the architecture name should be appended to the name of binaries.
|
|
/// </summary>
|
|
/// <returns>True if the architecture name should be appended to the binary</returns>
|
|
public virtual bool RequiresArchitectureSuffix()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// For platforms that need to output multiple files per binary (ie Android "fat" binaries)
|
|
/// this will emit multiple paths. By default, it simply makes an array from the input
|
|
/// </summary>
|
|
public virtual List<FileReference> FinalizeBinaryPaths(FileReference BinaryName, FileReference ProjectFile, ReadOnlyTargetRules Target)
|
|
{
|
|
List<FileReference> TempList = new List<FileReference>() { BinaryName };
|
|
return TempList;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Return whether this platform has uniquely named binaries across multiple games
|
|
/// </summary>
|
|
public virtual bool HasUniqueBinaries()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Return whether we wish to have this platform's binaries in our builds
|
|
/// </summary>
|
|
public virtual bool IsBuildRequired()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Return whether we wish to have this platform's binaries in our CIS tests
|
|
/// </summary>
|
|
public virtual bool IsCISRequired()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Whether the build platform requires deployment prep
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public virtual bool RequiresDeployPrepAfterCompile()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Return all valid configurations for this platform
|
|
/// Typically, this is always Debug, Development, and Shipping - but Test is a likely future addition for some platforms
|
|
/// </summary>
|
|
public virtual List<UnrealTargetConfiguration> GetConfigurations(UnrealTargetPlatform InUnrealTargetPlatform, bool bIncludeDebug)
|
|
{
|
|
List<UnrealTargetConfiguration> Configurations = new List<UnrealTargetConfiguration>()
|
|
{
|
|
UnrealTargetConfiguration.Development,
|
|
};
|
|
|
|
if (bIncludeDebug)
|
|
{
|
|
Configurations.Insert(0, UnrealTargetConfiguration.Debug);
|
|
}
|
|
|
|
return Configurations;
|
|
}
|
|
|
|
protected static bool DoProjectSettingsMatchDefault(UnrealTargetPlatform Platform, DirectoryReference ProjectDirectoryName, string Section, string[] BoolKeys, string[] IntKeys, string[] StringKeys)
|
|
{
|
|
ConfigHierarchy ProjIni = ConfigCache.ReadHierarchy(ConfigHierarchyType.Engine, ProjectDirectoryName, Platform);
|
|
ConfigHierarchy DefaultIni = ConfigCache.ReadHierarchy(ConfigHierarchyType.Engine, (DirectoryReference)null, Platform);
|
|
|
|
// look at all bool values
|
|
if (BoolKeys != null) foreach (string Key in BoolKeys)
|
|
{
|
|
bool Default = false, Project = false;
|
|
DefaultIni.GetBool(Section, Key, out Default);
|
|
ProjIni.GetBool(Section, Key, out Project);
|
|
if (Default != Project)
|
|
{
|
|
Log.TraceInformationOnce(Key + " is not set to default. (" + Default + " vs. " + Project + ")");
|
|
return false;
|
|
}
|
|
}
|
|
|
|
// look at all int values
|
|
if (IntKeys != null) foreach (string Key in IntKeys)
|
|
{
|
|
int Default = 0, Project = 0;
|
|
DefaultIni.GetInt32(Section, Key, out Default);
|
|
ProjIni.GetInt32(Section, Key, out Project);
|
|
if (Default != Project)
|
|
{
|
|
Log.TraceInformationOnce(Key + " is not set to default. (" + Default + " vs. " + Project + ")");
|
|
return false;
|
|
}
|
|
}
|
|
|
|
// look for all string values
|
|
if (StringKeys != null) foreach (string Key in StringKeys)
|
|
{
|
|
string Default = "", Project = "";
|
|
DefaultIni.GetString(Section, Key, out Default);
|
|
ProjIni.GetString(Section, Key, out Project);
|
|
if (Default != Project)
|
|
{
|
|
Log.TraceInformationOnce(Key + " is not set to default. (" + Default + " vs. " + Project + ")");
|
|
return false;
|
|
}
|
|
}
|
|
|
|
// if we get here, we match all important settings
|
|
return true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Check for the default configuration
|
|
/// return true if the project uses the default build config
|
|
/// </summary>
|
|
public virtual bool HasDefaultBuildConfig(UnrealTargetPlatform Platform, DirectoryReference ProjectDirectoryName)
|
|
{
|
|
string[] BoolKeys = new string[] {
|
|
"bCompileApex", "bCompileBox2D", "bCompileICU", "bCompileSimplygon", "bCompileSimplygonSSF",
|
|
"bCompileLeanAndMeanUE", "bIncludeADO", "bCompileRecast", "bCompileSpeedTree",
|
|
"bCompileWithPluginSupport", "bCompilePhysXVehicle", "bCompileFreeType",
|
|
"bCompileForSize", "bCompileCEF3"
|
|
};
|
|
|
|
return DoProjectSettingsMatchDefault(Platform, ProjectDirectoryName, "/Script/BuildSettings.BuildSettings",
|
|
BoolKeys, null, null);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Get a list of extra modules the platform requires.
|
|
/// This is to allow undisclosed platforms to add modules they need without exposing information about the platform.
|
|
/// </summary>
|
|
/// <param name="Target">The target being build</param>
|
|
/// <param name="ExtraModuleNames">List of extra modules the platform needs to add to the target</param>
|
|
public virtual void AddExtraModules(ReadOnlyTargetRules Target, List<string> ExtraModuleNames)
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Modify the rules for a newly created module, in a target that's being built for this platform.
|
|
/// This is not required - but allows for hiding details of a particular platform.
|
|
/// </summary>
|
|
/// <param name="ModuleName">The name of the module</param>
|
|
/// <param name="Rules">The module rules</param>
|
|
/// <param name="Target">The target being build</param>
|
|
public virtual void ModifyModuleRulesForActivePlatform(string ModuleName, ModuleRules Rules, ReadOnlyTargetRules Target)
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Setup the target environment for building
|
|
/// </summary>
|
|
/// <param name="Target">Settings for the target being compiled</param>
|
|
/// <param name="CompileEnvironment">The compile environment for this target</param>
|
|
/// <param name="LinkEnvironment">The link environment for this target</param>
|
|
public abstract void SetUpEnvironment(ReadOnlyTargetRules Target, CppCompileEnvironment CompileEnvironment, LinkEnvironment LinkEnvironment);
|
|
|
|
/// <summary>
|
|
/// Setup the configuration environment for building
|
|
/// </summary>
|
|
/// <param name="Target">The target being built</param>
|
|
/// <param name="GlobalCompileEnvironment">The global compile environment</param>
|
|
/// <param name="GlobalLinkEnvironment">The global link environment</param>
|
|
public virtual void SetUpConfigurationEnvironment(ReadOnlyTargetRules Target, CppCompileEnvironment GlobalCompileEnvironment, LinkEnvironment GlobalLinkEnvironment)
|
|
{
|
|
if (GlobalCompileEnvironment.bUseDebugCRT)
|
|
{
|
|
GlobalCompileEnvironment.Definitions.Add("_DEBUG=1"); // the engine doesn't use this, but lots of 3rd party stuff does
|
|
}
|
|
else
|
|
{
|
|
GlobalCompileEnvironment.Definitions.Add("NDEBUG=1"); // the engine doesn't use this, but lots of 3rd party stuff does
|
|
}
|
|
|
|
switch (Target.Configuration)
|
|
{
|
|
default:
|
|
case UnrealTargetConfiguration.Debug:
|
|
GlobalCompileEnvironment.Definitions.Add("UE_BUILD_DEBUG=1");
|
|
break;
|
|
case UnrealTargetConfiguration.DebugGame:
|
|
// Individual game modules can be switched to be compiled in debug as necessary. By default, everything is compiled in development.
|
|
case UnrealTargetConfiguration.Development:
|
|
GlobalCompileEnvironment.Definitions.Add("UE_BUILD_DEVELOPMENT=1");
|
|
break;
|
|
case UnrealTargetConfiguration.Shipping:
|
|
GlobalCompileEnvironment.Definitions.Add("UE_BUILD_SHIPPING=1");
|
|
break;
|
|
case UnrealTargetConfiguration.Test:
|
|
GlobalCompileEnvironment.Definitions.Add("UE_BUILD_TEST=1");
|
|
break;
|
|
}
|
|
|
|
// Create debug info based on the heuristics specified by the user.
|
|
GlobalCompileEnvironment.bCreateDebugInfo =
|
|
!Target.bDisableDebugInfo && ShouldCreateDebugInfo(Target);
|
|
GlobalLinkEnvironment.bCreateDebugInfo = GlobalCompileEnvironment.bCreateDebugInfo;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Whether this platform should create debug information or not
|
|
/// </summary>
|
|
/// <param name="Target">The target being built</param>
|
|
/// <returns>bool true if debug info should be generated, false if not</returns>
|
|
public abstract bool ShouldCreateDebugInfo(ReadOnlyTargetRules Target);
|
|
|
|
/// <summary>
|
|
/// Creates a toolchain instance for the given platform. There should be a single toolchain instance per-target, as their may be
|
|
/// state data and configuration cached between calls.
|
|
/// </summary>
|
|
/// <param name="CppPlatform">The platform to create a toolchain for</param>
|
|
/// <param name="Target">The target being built</param>
|
|
/// <returns>New toolchain instance.</returns>
|
|
public abstract UEToolChain CreateToolChain(CppPlatform CppPlatform, ReadOnlyTargetRules Target);
|
|
|
|
/// <summary>
|
|
/// Deploys the given target
|
|
/// </summary>
|
|
/// <param name="Target">Information about the target being deployed</param>
|
|
public abstract void Deploy(UEBuildDeployTarget Target);
|
|
}
|
|
}
|