Skip to content

Commit

Permalink
Fix missing define in generated debug solution
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre Pion committed Jan 20, 2022
1 parent ac831ef commit d54a212
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Sharpmake.Application/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ public static Builder CreateBuilder(BuildContext.BaseBuildContext context, Argum
if (generateDebugSolution)
{
LogWriteLine("Generate debug solution...");
DebugProjectGenerator.GenerateDebugSolution(parameters.Sources, parameters.DebugSolutionPath, builder.Arguments, parameters.DebugSolutionStartArguments, parameters.Defines.ToArray());
DebugProjectGenerator.GenerateDebugSolution(parameters.Sources, parameters.DebugSolutionPath, builder.Arguments, parameters.DebugSolutionStartArguments);
builder.BuildProjectAndSolution();
return builder;
}
Expand Down
14 changes: 7 additions & 7 deletions Sharpmake/DebugProjectGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public virtual string GetSharpmakeExecutableFullPath()
/// <param name="startArguments"></param>
public static void GenerateDebugSolution(string[] sources, Arguments arguments, string startArguments)
{
GenerateDebugSolution(sources, arguments, startArguments, null);
GenerateDebugSolution(sources, null, arguments, startArguments);
}

/// <summary>
Expand All @@ -107,9 +107,10 @@ public static void GenerateDebugSolution(string[] sources, Arguments arguments,
/// <param name="arguments"></param>
/// <param name="startArguments"></param>
/// <param name="defines"></param>
[Obsolete("Defines should be inserted in the Sharpmake.Arguments parameter thus rendering this function useless ", error: true)]
public static void GenerateDebugSolution(string[] sources, Arguments arguments, string startArguments, string[] defines)
{
GenerateDebugSolution(sources, null, arguments, startArguments, defines);
GenerateDebugSolution(sources, null, arguments, startArguments);
}

/// <summary>
Expand All @@ -119,10 +120,9 @@ public static void GenerateDebugSolution(string[] sources, Arguments arguments,
/// <param name="solutionPath"></param>
/// <param name="arguments"></param>
/// <param name="startArguments"></param>
/// <param name="defines"></param>
internal static void GenerateDebugSolution(string[] sources, string solutionPath, Arguments arguments, string startArguments, string[] defines)
internal static void GenerateDebugSolution(string[] sources, string solutionPath, Arguments arguments, string startArguments)
{
FindAllSources(sources, solutionPath, arguments, startArguments, defines);
FindAllSources(sources, solutionPath, arguments, startArguments);
arguments.Generate<DebugSolution>();
}

Expand All @@ -144,7 +144,7 @@ internal class ProjectContent
}
internal static readonly Dictionary<Type, ProjectContent> DebugProjects = new Dictionary<Type, ProjectContent>();

private static void FindAllSources(string[] sourcesArguments, string solutionPath, Sharpmake.Arguments sharpmakeArguments, string startArguments, string[] defines)
private static void FindAllSources(string[] sourcesArguments, string solutionPath, Sharpmake.Arguments sharpmakeArguments, string startArguments)
{
MainSources = sourcesArguments;
if (!string.IsNullOrEmpty(solutionPath))
Expand All @@ -165,7 +165,7 @@ private static void FindAllSources(string[] sourcesArguments, string solutionPat
assembler.AttributeParsers.Add(new DebugProjectNameAttributeParser());
IAssemblyInfo assemblyInfo = assembler.LoadUncompiledAssemblyInfo(Builder.Instance.CreateContext(BuilderCompileErrorBehavior.ReturnNullAssembly), MainSources);

GenerateDebugProject(assemblyInfo, true, startArguments, new Dictionary<string, Type>(), defines);
GenerateDebugProject(assemblyInfo, true, startArguments, new Dictionary<string, Type>(), sharpmakeArguments.Builder.Defines.ToArray());
}

private static Type GenerateDebugProject(IAssemblyInfo assemblyInfo, bool isSetupProject, string startArguments, IDictionary<string, Type> visited, string[] defines)
Expand Down

0 comments on commit d54a212

Please sign in to comment.