Files
UnrealEngineUWP/Engine/Source/Programs/ShaderCompileWorker/ShaderCompileWorker.Target.cs
josh adams c0f2905ce7 - Added a method for Shared build environment builds to have certain modules marked as caring about SDK version overrides for some platforms - if any of those platforms are overridden, the DLL will be written to the project Binaries dir instead of Engine (set bAllowSDKOverrideModulesWithSharedEnvironment = true in a Target.cs)
- Added ability to optionally skip SDK validation when making a Target instance even if we don't want to skip Target validation (used when we make the base UnrealEditor target to compare to project's Editor target - we don't need to manage SDK for that temporary UnrealEditor target).
- ShaderCompileWorker is now BuildEnvironment.UniqueIfNeeded, which will build into the project binaries dir if needed (based on per-project SDK override)
- UnrealPak is marked as not caring about an SDK versions so it can be built along with SCW that does care
- Added $(BinaryDir) variable to UEBuildTarget, etc, for the location of the first Binary in the output binaries
#rb David.Harvey, Joe.Kirchoff

[CL 31661939 by josh adams in ue5-main branch]
2024-02-20 18:39:20 -05:00

72 lines
2.8 KiB
C#

// Copyright Epic Games, Inc. All Rights Reserved.
using System.Collections.Generic;
using System.IO;
using UnrealBuildTool;
[SupportedPlatforms(UnrealPlatformClass.Editor)]
public class ShaderCompileWorkerTarget : TargetRules
{
public ShaderCompileWorkerTarget(TargetInfo Target) : base(Target)
{
Type = TargetType.Program;
LinkType = TargetLinkType.Modular;
IncludeOrderVersion = EngineIncludeOrderVersion.Latest;
BuildEnvironment = TargetBuildEnvironment.UniqueIfNeeded;
LaunchModuleName = "ShaderCompileWorker";
if (bUseXGEController && (Target.Platform == UnrealTargetPlatform.Win64) && Configuration == UnrealTargetConfiguration.Development)
{
// The interception interface in XGE requires that the parent and child processes have different filenames on disk.
// To avoid building an entire separate worker just for this, we duplicate the ShaderCompileWorker in a post build step.
const string SrcPath = "$(BinaryDir)\\$(TargetName).exe";
const string DestPath = "$(BinaryDir)\\XGEControlWorker.exe";
PostBuildSteps.Add(string.Format("echo Copying {0} to {1}", SrcPath, DestPath));
PostBuildSteps.Add(string.Format("copy /Y /B \"{0}\" /B \"{1}\" >nul:", SrcPath, DestPath));
AdditionalBuildProducts.Add(DestPath);
}
// Turn off various third party features we don't need
// Currently we force Lean and Mean mode
bBuildDeveloperTools = false;
// ShaderCompileWorker isn't localized, so doesn't need ICU
bCompileICU = false;
// Currently this app is not linking against the engine, so we'll compile out references from Core to the rest of the engine
bCompileAgainstEngine = false;
bCompileAgainstCoreUObject = false;
bBuildWithEditorOnlyData = true;
bCompileCEF3 = false;
// Force all shader formats to be built and included.
bForceBuildShaderFormats = true;
// ShaderCompileWorker is a console application, not a Windows app (sets entry point to main(), instead of WinMain())
bIsBuildingConsoleApplication = true;
// Disable logging, as the workers are spawned often and logging will just slow them down
GlobalDefinitions.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.
GlobalDefinitions.Add("ALLOW_WINDOWS_ERROR_REPORT_LIB=0");
// Disable external profiling in ShaderCompiler to improve startup time
GlobalDefinitions.Add("UE_EXTERNAL_PROFILING_ENABLED=0");
// This removes another thread being created even when -nocrashreports is specified
GlobalDefinitions.Add("NOINITCRASHREPORTER=1");
if (bShaderCompilerWorkerTrace)
{
GlobalDefinitions.Add("LLM_ENABLED_IN_CONFIG=1");
GlobalDefinitions.Add("UE_MEMORY_TAGS_TRACE_ENABLED=1");
bEnableTrace = true;
}
}
}