From ab7ca683bb684745c2ee0751e5d178a490000289 Mon Sep 17 00:00:00 2001 From: Andrew Spiering Date: Fri, 22 Sep 2023 02:59:38 -0700 Subject: [PATCH] Addressing Feedback * use a better method of getting Editor binary folder --- Source/Tools/Flax.Build/Build/Builder.Projects.cs | 4 ++-- .../VisualStudio/VisualStudioProjectGenerator.cs | 10 ++-------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/Source/Tools/Flax.Build/Build/Builder.Projects.cs b/Source/Tools/Flax.Build/Build/Builder.Projects.cs index 52c6d4ac9..166e78036 100644 --- a/Source/Tools/Flax.Build/Build/Builder.Projects.cs +++ b/Source/Tools/Flax.Build/Build/Builder.Projects.cs @@ -497,7 +497,7 @@ namespace Flax.Build else if (dependencyModule.BinaryModuleName == "FlaxEngine") { // TODO: instead of this hack find a way to reference the prebuilt target bindings binary (example: game C# project references FlaxEngine C# prebuilt dll) - project.CSharp.FileReferences.Add(Path.Combine(Globals.EngineRoot, $"Binaries/Editor/{project.Configurations[0].PlatformName}/Development/FlaxEngine.CSharp.dll")); + project.CSharp.FileReferences.Add(Path.Combine(Globals.EngineRoot, Platform.GetEditorBinaryDirectory(), "Development/FlaxEngine.CSharp.dll")); } } } @@ -519,7 +519,7 @@ namespace Flax.Build project.Dependencies.Remove(flaxDependency); // TODO: instead of this hack find a way to reference the prebuilt target bindings binary (example: game C# project references FlaxEngine C# prebuilt dll) - project.CSharp.FileReferences.Add(Path.Combine(Globals.EngineRoot, $"Binaries/Editor/{project.Configurations[0].PlatformName}/Development/FlaxEngine.CSharp.dll")); + project.CSharp.FileReferences.Add(Path.Combine(Globals.EngineRoot, Platform.GetEditorBinaryDirectory(), "Development/FlaxEngine.CSharp.dll")); // Remove FlaxEngine from projects to prevent duplicated types errors in Intellisense (eg. Actor type defined in both FlaxEngine.CSharp.dll and FlaxEngine.csproj) flaxDependencyToRemove = flaxDependency; diff --git a/Source/Tools/Flax.Build/Projects/VisualStudio/VisualStudioProjectGenerator.cs b/Source/Tools/Flax.Build/Projects/VisualStudio/VisualStudioProjectGenerator.cs index 16ab543ad..8cbd6b01a 100644 --- a/Source/Tools/Flax.Build/Projects/VisualStudio/VisualStudioProjectGenerator.cs +++ b/Source/Tools/Flax.Build/Projects/VisualStudio/VisualStudioProjectGenerator.cs @@ -405,8 +405,6 @@ namespace Flax.Build.Projects.VisualStudio vcSolutionFileContent.AppendLine("EndProject"); } - var globalPlatformName = ""; - // Global configuration { vcSolutionFileContent.AppendLine("Global"); @@ -423,11 +421,7 @@ namespace Flax.Build.Projects.VisualStudio continue; 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)); } } @@ -564,7 +558,7 @@ namespace Flax.Build.Projects.VisualStudio { var profiles = new Dictionary(); var profile = new StringBuilder(); - var editorPath = Utilities.NormalizePath(Path.Combine(Globals.EngineRoot, $"Binaries/Editor/{globalPlatformName}/Development/FlaxEditor{Utilities.GetPlatformExecutableExt()}")); + var editorPath = Utilities.NormalizePath(Path.Combine(Globals.EngineRoot, Platform.GetEditorBinaryDirectory(), $"Development/FlaxEditor{Utilities.GetPlatformExecutableExt()}")); var workspacePath = Utilities.NormalizePath(solutionDirectory); foreach (var project in projects) {