Skip to content

Commit 0ab6b3c

Browse files
authored
Merge e29faa9 into 08e5140
2 parents 08e5140 + e29faa9 commit 0ab6b3c

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

CefSharp/DependencyChecker.cs

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@
55
using System;
66
using System.Collections.Generic;
77
using System.IO;
8+
#if NETCOREAPP
9+
using System.Linq;
10+
#endif
811
using System.Reflection;
12+
#if NETCOREAPP
13+
using System.Runtime.InteropServices;
14+
#endif
915
using System.Text;
1016

1117
namespace CefSharp
@@ -21,6 +27,11 @@ public static class DependencyChecker
2127
/// </summary>
2228
public const string LocalesPackFile = @"locales\en-US.pak";
2329

30+
/// <summary>
31+
/// File name of the Direct3D Compiler DLL.
32+
/// </summary>
33+
private const string D3DCompilerDll = "d3dcompiler_47.dll";
34+
2435
/// <summary>
2536
/// List of Cef Dependencies
2637
/// </summary>
@@ -60,7 +71,8 @@ public static class DependencyChecker
6071
// Note: Without these components HTML5 accelerated content like 2D canvas, 3D CSS and WebGL will not function.
6172
"libEGL.dll",
6273
"libGLESv2.dll",
63-
"d3dcompiler_47.dll",
74+
// The D3D Compiler isn't included in the win-arm64 redist; we remove it in the static constructor.
75+
D3DCompilerDll,
6476
//Crashpad support
6577
"chrome_elf.dll"
6678
};
@@ -99,6 +111,17 @@ public static class DependencyChecker
99111
#endif
100112
};
101113

114+
#if NETCOREAPP
115+
static DependencyChecker()
116+
{
117+
// win-arm64 doesn't ship with a copy of the D3D Compiler, it's included with the OS.
118+
if (RuntimeInformation.ProcessArchitecture is Architecture.Arm64)
119+
{
120+
CefOptionalDependencies = CefOptionalDependencies.Where(x => x != D3DCompilerDll).ToArray();
121+
}
122+
}
123+
#endif
124+
102125
/// <summary>
103126
/// CheckDependencies iterates through the list of Cef and CefSharp dependencines
104127
/// relative to the path provided and returns a list of missing ones

0 commit comments

Comments
 (0)