Disable D2D1 generator if unsafe blocks are not allowed
このコミットが含まれているのは:
1 親
33e0eb6f49
コミット
24ac70faa4
2ファイル変更
+17
検索条件に一致するファイルはありません
@@ -6,6 +6,7 @@ using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.CSharp;
|
||||
|
||||
namespace ComputeSharp.SourceGeneration.Extensions;
|
||||
|
||||
@@ -45,6 +46,16 @@ internal static class CompilationExtensions
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether the <c>AllowUnsafeBlocks</c> option is set for a given compilation.
|
||||
/// </summary>
|
||||
/// <param name="compilation">The <see cref="Compilation"/> object to check.</param>
|
||||
/// <returns>Whether the <c>AllowUnsafeBlocks</c> option is set for <paramref name="compilation"/>.</returns>
|
||||
public static bool IsAllowUnsafeBlocksEnabled(this Compilation compilation)
|
||||
{
|
||||
return compilation.Options is CSharpCompilationOptions { AllowUnsafe: true };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Checks whether or not a type with a specified metadata name is accessible from a given <see cref="Compilation"/> instance.
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする