Open DDev101 opened 4 months ago
Hello! I'm unsure if this is a bug or something I'm doing incorrectly.
I'm unable to get the .csproj to generate the project configuration to match the .sln configurations.
Here is the example I created that produces the issue:
using Sharpmake; using System.Reflection; using System.Text.Json; using System.Collections.Generic; using System.Linq; using System.IO; using System; [Fragment, Flags] public enum ErrorFlag { First = 1, Second = 2 } public class ErrorTarget : ITarget { public DevEnv DevEnv; public Platform Platform; public Optimization Optimization; public DotNetFramework Framework; public BuildSystem BuildSystem; public ErrorFlag ErrorFlag; } [Generate] public class ErrorProject : CSharpProject { public ErrorProject() : base(typeof(ErrorTarget)) { AddTargets(new ErrorTarget { DevEnv = DevEnv.vs2022, Platform = Platform.win64, Optimization = Optimization.Debug | Optimization.Release | Optimization.Retail, Framework = DotNetFramework.net6_0, BuildSystem = BuildSystem.MSBuild, ErrorFlag = ErrorFlag.First | ErrorFlag.Second }); RootPath = @Path.Combine("[project.SharpmakeCsPath]"); SourceRootPath = @Path.Combine("[project.SharpmakeCsPath]"); } [Configure] public void Configure(Project.Configuration conf, ErrorTarget target) { conf.Name = "[target.Platform]_[target.Optimization]_[target.ErrorFlag]"; conf.TargetPath = "[project.SharpmakeCsPath]/generated"; } }; [Generate] public class DemoSolution : Solution { public DemoSolution() : base(typeof(ErrorTarget)) { AddTargets(new ErrorTarget { DevEnv = DevEnv.vs2022, Platform = Platform.win64, Optimization = Optimization.Debug | Optimization.Release | Optimization.Retail, Framework = DotNetFramework.net6_0, BuildSystem = BuildSystem.MSBuild, ErrorFlag = ErrorFlag.First | ErrorFlag.Second }); } [Configure] public void Configure(Solution.Configuration conf, ErrorTarget target) { conf.Name = "[target.Platform]_[target.Optimization]_[target.ErrorFlag]"; conf.SolutionPath = Path.Combine("generated", "[target.DevEnv]"); conf.AddProject<ErrorProject>(target); } } public static class Main { [Sharpmake.Main] public static void SharpmakeMain(Arguments arguments) { KitsRootPaths.SetUseKitsRootForDevEnv(DevEnv.vs2022, KitsRootEnum.KitsRoot10, Options.Vc.General.WindowsTargetPlatformVersion.Latest); // Generate solutions arguments.Generate(typeof(DemoSolution)); } }
Hello! I'm unsure if this is a bug or something I'm doing incorrectly.
I'm unable to get the .csproj to generate the project configuration to match the .sln configurations.
Here is the example I created that produces the issue: