Skip to content

Commit

Permalink
Only allow plugin debugging when debugger is attached
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrette committed Oct 8, 2023
1 parent 30ba953 commit b162aa1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Carbon.Core/Carbon/src/Jobs/ScriptCompilationThread.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.CodeDom.Compiler;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
Expand Down Expand Up @@ -333,7 +334,7 @@ public override void ThreadFunction()

string pdb_filename =
#if DEBUG
FilePath;
Debugger.IsAttached ? FilePath : FileName + ".cs";
#else
FileName + ".cs";
#endif
Expand Down Expand Up @@ -369,9 +370,9 @@ public override void ThreadFunction()
OutputKind.DynamicallyLinkedLibrary,
optimizationLevel:
#if DEBUG
OptimizationLevel.Debug,
Debugger.IsAttached ? OptimizationLevel.Debug : OptimizationLevel.Release,
#else
OptimizationLevel.Release,
OptimizationLevel.Release,
#endif
deterministic: true, warningLevel: 4
);
Expand Down

0 comments on commit b162aa1

Please sign in to comment.