diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ebad678..f410f39 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -252,6 +252,20 @@ jobs: name: logs_5_1 path: .\logs + # This step is only used to add a required check for the PR + Validation_Check: + name: Validation Check + runs-on: windows-latest + needs: + - build_tool + - validation_5_1 + - validation_5_2_win + - validation_5_2_nix + + steps: + - name: Checkout + uses: actions/checkout@v4 + sign: name: Sign if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')) }} diff --git a/src/Resizetizer/src/SkiaSharpTools.Initializer.cs b/src/Resizetizer/src/SkiaSharpTools.Initializer.cs index 1214a01..61fc5a0 100644 --- a/src/Resizetizer/src/SkiaSharpTools.Initializer.cs +++ b/src/Resizetizer/src/SkiaSharpTools.Initializer.cs @@ -36,6 +36,31 @@ public static void Initialize() { SetupResolver(); } + else + { + SetupWindows(); + } + } + } + + /// + /// Load libraries explicitly on Windows, as search paths may not be available when + /// running inside VS msbuild nodes. + /// + private static void SetupWindows() + { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + foreach (var runtimePath in GetRuntimesFolder()) + { + if (Directory.Exists(runtimePath)) + { + foreach (var file in Directory.GetFiles(runtimePath, "*.dll")) + { + var r = LoadLibrary(file); + } + } + } } } @@ -184,6 +209,10 @@ IntPtr localDlOpen(string fileName) [DllImport("libSystem.dylib", EntryPoint = "dlopen")] public static extern IntPtr dlopen_macos(string fileName, int flags); + // Declare dllimport for loadlibrary + [DllImport("kernel32.dll", SetLastError = true)] + public static extern IntPtr LoadLibrary(string lpFileName); + // Imported from https://github.com/mono/SkiaSharp/blob/482e6ee2913a08a7cad76520ccf5fbce97c7c23b/binding/Binding.Shared/LibraryLoader.cs private static class Linux {