2021-07-14 15:26:40 -04:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using EpicGames.Core;
|
|
|
|
|
using UnrealBuildTool;
|
|
|
|
|
|
|
|
|
|
// Abstract base class for texture worker targets. Not a valid target by itself, hence it is not put into a *.target.cs file.
|
|
|
|
|
[SupportedPlatforms(UnrealPlatformClass.Desktop)]
|
|
|
|
|
public abstract class TextureBuildWorkerTarget : DerivedDataBuildWorkerTarget
|
|
|
|
|
{
|
|
|
|
|
public TextureBuildWorkerTarget(TargetInfo Target) : base(Target)
|
|
|
|
|
{
|
|
|
|
|
SolutionDirectory += "/Texture";
|
2021-08-09 16:32:18 -04:00
|
|
|
|
|
|
|
|
var ProjectDesc = ProjectFile != null ? ProjectDescriptor.FromFile(ProjectFile) : null;
|
|
|
|
|
|
|
|
|
|
// Determine if TextureFormatOodle is enabled.
|
|
|
|
|
var TextureFormatOodleUPluginFile = new FileReference("../Plugins/Developer/TextureFormatOodle/TextureFormatOodle.uplugin");
|
|
|
|
|
var TextureFormatOodlePlugin = new PluginInfo(TextureFormatOodleUPluginFile, PluginType.Engine);
|
|
|
|
|
|
|
|
|
|
bool bTextureFormatOodlePluginEnabled =
|
|
|
|
|
Plugins.IsPluginEnabledForTarget(TextureFormatOodlePlugin, ProjectDesc, Target.Platform, Target.Configuration, TargetType.Program);
|
|
|
|
|
|
|
|
|
|
if (bTextureFormatOodlePluginEnabled)
|
|
|
|
|
{
|
|
|
|
|
ExtraModuleNames.Add("TextureFormatOodle");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// Check for a project specific Oodle plugin
|
|
|
|
|
foreach (PluginReferenceDescriptor PluginReference in ProjectDesc.Plugins)
|
|
|
|
|
{
|
|
|
|
|
if (String.Compare(PluginReference.Name, "Oodle", true) == 0 && !PluginReference.bOptional)
|
|
|
|
|
{
|
|
|
|
|
ExtraModuleNames.Add("OodleDXTTextureFormat");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-07-14 15:26:40 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class TextureBuildWorker : ModuleRules
|
|
|
|
|
{
|
|
|
|
|
public TextureBuildWorker(ReadOnlyTargetRules Target) : base(Target)
|
|
|
|
|
{
|
|
|
|
|
PrivateIncludePathModuleNames.Add("DerivedDataCache");
|
|
|
|
|
PrivateDependencyModuleNames.Add("DerivedDataBuildWorker");
|
|
|
|
|
}
|
|
|
|
|
}
|