Files
UnrealEngineUWP/Engine/Source/Programs/UnrealBuildTool/Platform/Windows/WindowsProjectGenerator.cs
Josh Adams 4d71a93586 - Added ability to have a IDE project for each Target (UnrealGame vs UnrealEditor) and remove the Type from the Configurations (Debug, Development, etc - no more Development Editor config)
- Enabled for Xcode, added support but left disabled for VisualStudio
- For Games and Samples with multiple projects, a solution folder now contains them
#rb joe.kirchoff
#preflight 63efb20061378b7ea02bc32d

[CL 24285567 by Josh Adams in ue5-main branch]
2023-02-17 12:53:28 -05: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 && InTargetRules.ProjectFile != null)
{
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;
}
}
}