Files
UnrealEngineUWP/Engine/Source/Programs/UnrealBuildTool/Platform/Windows/WindowsProjectGenerator.cs
David Harvey a3e5c385b5 Debugger arguments are set up correctly for Windows-based platform extensions
#jira UE-146417, UE-131865
#rnx
#preflight 6239e2dadb0f61c7925d2989
#rb Eric.McDaniel

[CL 19492929 by David Harvey in ue5-main branch]
2022-03-24 05:42:08 -04:00

86 lines
2.6 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;
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>
public WindowsProjectGenerator(CommandLineArguments Arguments)
: base(Arguments)
{
}
/// <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;
}
}
}