Files
UnrealEngineUWP/Engine/Source/Programs/UnrealBuildTool/System/SupportedPlatformsAttribute.cs
Juan Canada 2ecf4f9708 Merging //UE4/Dev-Main@10877709 to Dev-RenderPlat-Staging(//UE4/Dev-Rendering)
#rnx
#rb none

[CL 10895568 by Juan Canada in Dev-RenderPlat-Staging branch]
2020-01-07 13:45:01 -05:00

50 lines
1.4 KiB
C#

// Copyright Epic Games, Inc. All Rights Reserved.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace UnrealBuildTool
{
/// <summary>
/// Attribute which can be applied to a TargetRules-dervied class to indicate which platforms it supports
/// </summary>
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
public class SupportedPlatformsAttribute : Attribute
{
/// <summary>
/// Array of supported platforms
/// </summary>
public readonly UnrealTargetPlatform[] Platforms;
/// <summary>
/// Initialize the attribute with a list of platforms
/// </summary>
/// <param name="Platforms">Variable-length array of platform arguments</param>
public SupportedPlatformsAttribute(params string[] Platforms)
{
try
{
this.Platforms = Array.ConvertAll(Platforms, x => UnrealTargetPlatform.Parse(x));
}
catch (BuildException Ex)
{
Tools.DotNETCommon.ExceptionUtils.AddContext(Ex, "while parsing a SupportedPlatforms attribute");
throw;
}
}
/// <summary>
/// Initialize the attribute with all the platforms in a given category
/// </summary>
/// <param name="Category">Category of platforms to add</param>
public SupportedPlatformsAttribute(UnrealPlatformClass Category)
{
this.Platforms = Utils.GetPlatformsInClass(Category);
}
}
}