Files
brandon schaefer 0630515e82 GetMainVersion now requires a registered platform, which only can be done from the Linux SDK that was first registered. Current StripSymbols was making a new LinuxPlatformSDK which wont be registered and fails getting the MainVersion
Now we will use the existing LinuxPlatfromSDK or if doesn't exist make a new one and correctly register it

#jira UE-193418
#rb Josh.Adams, Zack.Neyland

[CL 27323816 by brandon schaefer in ue5-main branch]
2023-08-23 17:56:35 -04:00

34 lines
978 B
C#

// Copyright Epic Games, Inc. All Rights Reserved.
using EpicGames.Core;
using Microsoft.Extensions.Logging;
namespace UnrealBuildTool
{
/// <summary>
/// Public Linux functions exposed to UAT
/// </summary>
public class LinuxExports
{
/// <summary>
///
/// </summary>
/// <param name="SourceFile"></param>
/// <param name="TargetFile"></param>
/// <param name="Logger">Logger for output</param>
public static void StripSymbols(FileReference SourceFile, FileReference TargetFile, ILogger Logger)
{
LinuxPlatformSDK? LinuxSDK = UEBuildPlatformSDK.GetSDKForPlatform("Linux") as LinuxPlatformSDK;
if (LinuxSDK == null)
{
LinuxSDK = new LinuxPlatformSDK(Logger);
UEBuildPlatformSDK.RegisterSDKForPlatform(LinuxSDK, "Linux", true);
}
LinuxToolChain ToolChain = new LinuxToolChain(LinuxPlatform.DefaultHostArchitecture, LinuxSDK, ClangToolChainOptions.None, Logger);
ToolChain.StripSymbols(SourceFile, TargetFile, Logger);
}
}
}