Skip to content

Commit

Permalink
Compile generated C# with release flags
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMagzuz authored and Bliztle committed Apr 25, 2024
1 parent e56fad6 commit b1023e7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion SocietalConstructionTool/SctRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,10 @@ private static EmitResult Emit(string sourceText, Stream outputStream)
).Concat(referenceTypes.Select(GetReferenceFromType))!;

var compilation = CSharpCompilation.Create(generatedAssemblyName)
.WithOptions(new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary))
.WithOptions(
new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)
.WithOptimizationLevel(OptimizationLevel.Release)
)
.AddReferences(references)
.AddSyntaxTrees(tree);

Expand Down

0 comments on commit b1023e7

Please sign in to comment.