Files
UnrealEngineUWP/Engine/Source/Programs/UnrealBuildTool/Configuration/UEBuildGame.cs
Steve Robb 499def698b UBT cleanups:
* Removal of some null checks.
* Some arrays changed to Lists.
* Some lists changed to IEnumerables.
* Some loops changed to Linq actions.
* FilterOnlyModules and FilterGameModules renamed to GetFiltered* functions, which better represent what they do.
* Some indentation fixes.
* Some thrown exceptions moved around to more appropriate locations.

#codereview robert.manuszewski

[CL 2554771 by Steve Robb in Main branch]
2015-05-18 08:16:56 -04:00

95 lines
2.9 KiB
C#

// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace UnrealBuildTool
{
[Serializable]
public class UEBuildGame : UEBuildTarget
{
public UEBuildGame(TargetDescriptor InDesc, TargetRules InRulesObject, string InTargetCsFilename)
: base(InDesc, InRulesObject, "UE4", InTargetCsFilename)
{
if (ShouldCompileMonolithic())
{
if (!UnrealBuildTool.IsDesktopPlatform(Platform) || Platform == UnrealTargetPlatform.WinRT || Platform == UnrealTargetPlatform.WinRT_ARM)
{
// We are compiling for a console...
// We want the output to go into the <GAME>\Binaries folder
if (!InRulesObject.bOutputToEngineBinaries)
{
OutputPaths = OutputPaths.Select(Path => Path.Replace("Engine\\Binaries", InDesc.TargetName + "\\Binaries")).ToList();
}
}
}
}
//
// UEBuildTarget interface.
//
protected override void SetupModules()
{
base.SetupModules();
}
/// <summary>
/// Setup the binaries for this target
/// </summary>
protected override void SetupBinaries()
{
base.SetupBinaries();
{
// Make the game executable.
UEBuildBinaryConfiguration Config = new UEBuildBinaryConfiguration( InType: UEBuildBinaryType.Executable,
InOutputFilePaths: OutputPaths,
InIntermediateDirectory: EngineIntermediateDirectory,
bInCreateImportLibrarySeparately: (ShouldCompileMonolithic() ? false : true),
bInAllowExports:!ShouldCompileMonolithic(),
InModuleNames: new List<string>() { "Launch" } );
AppBinaries.Add( new UEBuildBinaryCPP( this, Config ) );
}
// Add the other modules that we want to compile along with the executable. These aren't necessarily
// dependencies to any of the other modules we're building, so we need to opt in to compile them.
{
// Modules should properly identify the 'extra modules' they need now.
// There should be nothing here!
}
}
public override void SetupDefaultGlobalEnvironment(
TargetInfo Target,
ref LinkEnvironmentConfiguration OutLinkEnvironmentConfiguration,
ref CPPEnvironmentConfiguration OutCPPEnvironmentConfiguration
)
{
UEBuildConfiguration.bCompileLeanAndMeanUE = true;
// Do not include the editor
UEBuildConfiguration.bBuildEditor = false;
UEBuildConfiguration.bBuildWithEditorOnlyData = false;
// Require cooked data
UEBuildConfiguration.bBuildRequiresCookedData = true;
// Compile the engine
UEBuildConfiguration.bCompileAgainstEngine = true;
// Tag it as a 'Game' build
OutCPPEnvironmentConfiguration.Definitions.Add("UE_GAME=1");
// no exports, so no need to verify that a .lib and .exp file was emitted by the linker.
OutLinkEnvironmentConfiguration.bHasExports = false;
}
}
}