Files
UnrealEngineUWP/Engine/Source/Programs/UnrealBuildTool/Platform/Windows/WindowsProjectGenerator.cs
UnrealBot 73409369c0 Branch snapshot for CL 21319338
[CL 21319338 in ue5-main branch]
2022-08-10 16:03:37 +00:00

88 lines
2.7 KiB
C#

// Copyright Epic Games, Inc. All Rights Reserved.
using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using System.IO;
using EpicGames.Core;
using Microsoft.Extensions.Logging;
namespace UnrealBuildTool
{
/// <summary>
/// Base class for platform-specific project generators
/// </summary>
class WindowsProjectGenerator : PlatformProjectGenerator
{
/// <summary>
/// Constructor
/// </summary>
/// <param name="Arguments">Command line arguments passed to the project generator</param>
/// <param name="Logger">Logger for output</param>
public WindowsProjectGenerator(CommandLineArguments Arguments, ILogger Logger)
: base(Arguments, Logger)
{
}
/// <summary>
/// Enumerate all the platforms that this generator supports
/// </summary>
public override IEnumerable<UnrealTargetPlatform> GetPlatforms()
{
yield return UnrealTargetPlatform.Win64;
}
///
/// VisualStudio project generation functions
///
/// <summary>
/// Return the VisualStudio platform name for this build platform
/// </summary>
/// <param name="InPlatform"> The UnrealTargetPlatform being built</param>
/// <param name="InConfiguration"> The UnrealTargetConfiguration being built</param>
/// <returns>string The name of the platform that VisualStudio recognizes</returns>
public override string GetVisualStudioPlatformName(UnrealTargetPlatform InPlatform, UnrealTargetConfiguration InConfiguration)
{
if (InPlatform == UnrealTargetPlatform.Win64)
{
return "x64";
}
return InPlatform.ToString();
}
public override string GetVisualStudioUserFileStrings(UnrealTargetPlatform InPlatform, UnrealTargetConfiguration InConfiguration, string InConditionString, TargetRules InTargetRules, FileReference TargetRulesPath, FileReference ProjectFilePath, string ProjectName, string? ForeignUProjectPath)
{
StringBuilder VCUserFileContent = new StringBuilder();
VCUserFileContent.AppendLine(" <PropertyGroup {0}>", InConditionString);
if (InTargetRules.Type != TargetType.Game)
{
string DebugOptions = "";
if (ForeignUProjectPath != null)
{
DebugOptions += ForeignUProjectPath;
DebugOptions += " -skipcompile";
}
else if (InTargetRules.Type == TargetType.Editor && ProjectName != ProjectFileGenerator.EngineProjectFileNameBase)
{
DebugOptions += ProjectName;
}
VCUserFileContent.AppendLine(" <LocalDebuggerCommandArguments>{0}</LocalDebuggerCommandArguments>", DebugOptions);
}
VCUserFileContent.AppendLine(" <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>");
VCUserFileContent.AppendLine(" </PropertyGroup>");
return VCUserFileContent.ToString();
}
public override bool RequiresVSUserFileGeneration()
{
return true;
}
}
}