Skip to content

Commit

Permalink
properly check for debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
LeNitrous committed Jul 14, 2023
1 parent 9e462ef commit 6d6dade
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions source/Sekai/RuntimeInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// Licensed under MIT. See LICENSE for details.

using System;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.Versioning;

namespace Sekai;
Expand All @@ -14,13 +17,7 @@ public static class RuntimeInfo
/// <summary>
/// Whether execution is currently in debug mode.
/// </summary>
public static readonly bool IsDebug =
#if DEBUG
true
#else
false
#endif
;
public static readonly bool IsDebug;

/// <summary>
/// Gets the operating system currently in execution.
Expand Down Expand Up @@ -110,6 +107,8 @@ static RuntimeInfo()

if (OperatingSystem.IsIOS())
OS = Platform.iOS;

IsDebug = Assembly.GetEntryAssembly()!.GetCustomAttributes<DebuggableAttribute>().Any(a => a.IsJITTrackingEnabled);
}

/// <summary>
Expand Down

0 comments on commit 6d6dade

Please sign in to comment.