Fixing Editor Path

* Again the path was hardcoded to win64
This commit is contained in:
Andrew Spiering
2023-09-22 02:41:09 -07:00
parent 017967d5f8
commit 1537f49e73
2 changed files with 23 additions and 2 deletions

View File

@@ -405,6 +405,8 @@ namespace Flax.Build.Projects.VisualStudio
vcSolutionFileContent.AppendLine("EndProject"); vcSolutionFileContent.AppendLine("EndProject");
} }
var globalPlatformName = "";
// Global configuration // Global configuration
{ {
vcSolutionFileContent.AppendLine("Global"); vcSolutionFileContent.AppendLine("Global");
@@ -422,6 +424,10 @@ namespace Flax.Build.Projects.VisualStudio
foreach (var configuration in project.Configurations) foreach (var configuration in project.Configurations)
{ {
// We just grab the platform name from the first config
if (string.IsNullOrEmpty(globalPlatformName))
globalPlatformName = configuration.PlatformName;
configurations.Add(new SolutionConfiguration(configuration)); configurations.Add(new SolutionConfiguration(configuration));
} }
} }
@@ -558,8 +564,8 @@ namespace Flax.Build.Projects.VisualStudio
{ {
var profiles = new Dictionary<string, string>(); var profiles = new Dictionary<string, string>();
var profile = new StringBuilder(); var profile = new StringBuilder();
var editorPath = Path.Combine(Globals.EngineRoot, "Binaries/Editor/Win64/Development/FlaxEditor.exe").Replace('/', '\\').Replace("\\", "\\\\"); var editorPath = Utilities.NormalizePath(Path.Combine(Globals.EngineRoot, $"Binaries/Editor/{globalPlatformName}/Development/FlaxEditor{Utilities.GetPlatformExecutableExt()}"));
var workspacePath = solutionDirectory.Replace('/', '\\').Replace("\\", "\\\\"); var workspacePath = Utilities.NormalizePath(solutionDirectory);
foreach (var project in projects) foreach (var project in projects)
{ {
if (project.Type == TargetType.DotNetCore) if (project.Type == TargetType.DotNetCore)

View File

@@ -6,6 +6,7 @@ using System.Diagnostics;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices;
using System.Text; using System.Text;
namespace Flax.Build namespace Flax.Build
@@ -746,5 +747,19 @@ namespace Flax.Build
text = text.Replace(findWhat, replaceWith); text = text.Replace(findWhat, replaceWith);
File.WriteAllText(file, text); File.WriteAllText(file, text);
} }
/// <summary>
/// Returns back the exe ext for the current platform
/// </summary>
public static string GetPlatformExecutableExt()
{
var extEnding = ".exe";
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) || RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
extEnding = "";
}
return extEnding;
}
} }
} }