]> O.S.I.I.S - jp/crow.git/commitdiff
netcore cairo resolve dll to cairo-2 on windows
authorj-p <jp_bruyere@hotmail.com>
Tue, 28 Sep 2021 19:46:05 +0000 (21:46 +0200)
committerj-p <jp_bruyere@hotmail.com>
Tue, 28 Sep 2021 19:46:05 +0000 (21:46 +0200)
Samples/PerfTests/Program.cs
Samples/common/src/SampleBase.cs

index 8ec252ddb1ad5e53775994b8989dc6ab00735c8f..222b7e7a4bd5e13a102c6c9e03ad72a088f30c53 100644 (file)
@@ -19,6 +19,8 @@ namespace PerfTests
 
                        switch (libraryName)
                        {
+                               case "cairo":
+                                       return NativeLibrary.Load("cairo-2", assembly, null);
                                case "glfw3":
                                        return  NativeLibrary.Load("glfw", assembly, null);
                                case "rsvg-2.40":
index 3e0ef714c9872d0aa001c08556c8d8b6c5576b74..eee98f9a02e0346722227961e1bd9cc1b7642700 100644 (file)
@@ -22,6 +22,8 @@ namespace Samples
 
                        switch (libraryName)
                        {
+                               case "cairo":
+                                       return NativeLibrary.Load("cairo-2", assembly, null);
                                case "glfw3":
                                        return NativeLibrary.Load("glfw", assembly, null);
                                case "rsvg-2.40":
@@ -30,10 +32,11 @@ namespace Samples
                        Console.WriteLine($"[UNRESOLVE] {assembly} {libraryName}");
                        return IntPtr.Zero;
                }
-
                static SampleBase()
                {
-                       System.Runtime.Loader.AssemblyLoadContext.GetLoadContext(Assembly.GetExecutingAssembly()).ResolvingUnmanagedDll += resolveUnmanaged;
+                       System.Runtime.Loader.AssemblyLoadContext ctx =
+                               System.Runtime.Loader.AssemblyLoadContext.GetLoadContext(Assembly.GetExecutingAssembly());
+                       ctx.ResolvingUnmanagedDll += resolveUnmanaged;
                }
 #endif
                public SampleBase(IntPtr hWin) : base(800, 600, hWin) { }