You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
- Enabled with either r.XGEShaderCompile=1 in ConsoleVariables.ini, or -xgeshadercompile command line argument. [CL 2390644 by Daniel Wright in Main branch]
84 lines
2.7 KiB
C#
84 lines
2.7 KiB
C#
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
|
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using UnrealBuildTool;
|
|
|
|
public class ShaderCompileWorkerTarget : TargetRules
|
|
{
|
|
public ShaderCompileWorkerTarget(TargetInfo Target)
|
|
{
|
|
Type = TargetType.Program;
|
|
}
|
|
|
|
//
|
|
// TargetRules interface.
|
|
//
|
|
|
|
public override bool GetSupportedPlatforms(ref List<UnrealTargetPlatform> OutPlatforms)
|
|
{
|
|
return UnrealBuildTool.UnrealBuildTool.GetAllDesktopPlatforms(ref OutPlatforms, false);
|
|
}
|
|
|
|
public override bool ShouldCompileMonolithic(UnrealTargetPlatform InPlatform, UnrealTargetConfiguration InConfiguration)
|
|
{
|
|
if (UnrealBuildTool.UnrealBuildTool.CommandLineContains("-monolithic") == true)
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public override void SetupBinaries(
|
|
TargetInfo Target,
|
|
ref List<UEBuildBinaryConfiguration> OutBuildBinaryConfigurations,
|
|
ref List<string> OutExtraModuleNames
|
|
)
|
|
{
|
|
OutBuildBinaryConfigurations.Add(
|
|
new UEBuildBinaryConfiguration(InType: UEBuildBinaryType.Executable,
|
|
InModuleNames: new List<string>() { "ShaderCompileWorker" })
|
|
);
|
|
}
|
|
|
|
public override void SetupGlobalEnvironment(
|
|
TargetInfo Target,
|
|
ref LinkEnvironmentConfiguration OutLinkEnvironmentConfiguration,
|
|
ref CPPEnvironmentConfiguration OutCPPEnvironmentConfiguration
|
|
)
|
|
{
|
|
// Turn off various third party features we don't need
|
|
|
|
// Currently we force Lean and Mean mode
|
|
UEBuildConfiguration.bCompileLeanAndMeanUE = true;
|
|
|
|
// Currently this app is not linking against the engine, so we'll compile out references from Core to the rest of the engine
|
|
UEBuildConfiguration.bCompileAgainstEngine = false;
|
|
UEBuildConfiguration.bCompileAgainstCoreUObject = false;
|
|
UEBuildConfiguration.bBuildWithEditorOnlyData = true;
|
|
|
|
// Never use malloc profiling in ShaderCompileWorker.
|
|
BuildConfiguration.bUseMallocProfiler = false;
|
|
|
|
// Force all shader formats to be built and included.
|
|
UEBuildConfiguration.bForceBuildShaderFormats = true;
|
|
|
|
// ShaderCompileWorker is a console application, not a Windows app (sets entry point to main(), instead of WinMain())
|
|
OutLinkEnvironmentConfiguration.bIsBuildingConsoleApplication = true;
|
|
|
|
// Disable logging, as the workers are spawned often and logging will just slow them down
|
|
OutCPPEnvironmentConfiguration.Definitions.Add("ALLOW_LOG_FILE=0");
|
|
|
|
// Linking against wer.lib/wer.dll causes XGE to bail when the worker is run on a Windows 8 machine, so turn this off.
|
|
OutCPPEnvironmentConfiguration.Definitions.Add("ALLOW_WINDOWS_ERROR_REPORT_LIB=0");
|
|
}
|
|
public override bool GUBP_AlwaysBuildWithBaseEditor()
|
|
{
|
|
return true;
|
|
}
|
|
public override bool GUBP_NeedsPlatformSpecificDLLs()
|
|
{
|
|
return true;
|
|
}
|
|
}
|