diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c879823..47d0923 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,6 +23,12 @@ jobs: cmakeargs: -B build -A x64 -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE -DSDL_AUDIO:BOOL="0" -DSDL_TIMERS:BOOL="1" -DSDL_MISC:BOOL="0" -DSDL_DUMMYAUDIO:BOOL="0" -DSDL_RENDER:BOOL="0" -DSDL_OPENGL:BOOL="0" -DSDL_VULKAN:BOOL="0" -DSDL_DIRECTX:BOOL="0" -DSDL_FILE:BOOL="0" -DSDL_RENDER_D3D:BOOL="0" -DSDL_DUMMYVIDEO:BOOL="0" -DSDL_LOADSO:BOOL="0" -DSDL_OPENGLES:BOOL="0" -DSDL_TEST:BOOL="0" -DSDL_FILESYSTEM:BOOL="0" -DSDL_LIBUDEV:BOOL="0" -DSDL_OFFSCREEN:BOOL="0" -DSDL_VIDEO:BOOL="0" -DSDL_LOCALE:BOOL="0" -DSDL_VIRTUAL_JOYSTICK:BOOL="0" -DSDL_DISKAUDIO:BOOL="0" -DSDL_POWER:BOOL="0" -DSDL_WASAPI:BOOL="0" linkerfiles: SDL2_Native/build/Release/SDL2-static.lib libfiles: SDL2_Native/build/Release/SDL2.dll + - os: macos-latest + rid: osx-arm64 + additionalconfig: echo "Hi again." + cmakeargs: -B build + linkerfiles: SDL2_Native/build/*.a + libfiles: SDL2_Native/build/libSDL2-2.0.dylib runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v6 diff --git a/Directory.Build.props b/Directory.Build.props index 3ba709e..5d88186 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,8 +1,8 @@ net8.0 - 3.0.0 - 3.0.0 + 3.0.0.1 + 3.0.0.1 enable enable diff --git a/SDLControllerWrapper/DLLResolver.cs b/SDLControllerWrapper/DLLResolver.cs index 3f30e02..54a6693 100644 --- a/SDLControllerWrapper/DLLResolver.cs +++ b/SDLControllerWrapper/DLLResolver.cs @@ -36,14 +36,20 @@ internal static void RegisterDllResolver() ? Environment.Is64BitProcess ? "runtimes\\win-x64\\native\\" : "runtimes\\win-x86\\native\\" - : throw new NotSupportedException("Unsupported OS platform"); + : OperatingSystem.IsMacOS() + ? Environment.Is64BitProcess + ? "runtimes\\osx-arm64\\native\\" + : "runtimes\\osx-arm64\\native\\" + : throw new NotSupportedException("Unsupported OS platform"); private static readonly string[] LibraryNames = OperatingSystem.IsLinux() ? ["libSDL2.so", "libSDL2-2.0.so"] : OperatingSystem.IsWindows() ? ["SDL2.dll"] - : throw new NotSupportedException("Unsupported OS platform"); + : OperatingSystem.IsMacOS() + ? ["libSDL2.dylib", "libSDL2-2.0.dylib"] + : throw new NotSupportedException("Unsupported OS platform"); private static IntPtr ImportResolver(string libraryName, Assembly assembly, DllImportSearchPath? searchPath) { diff --git a/SDLControllerWrapper/SDLControllerWrapper.csproj b/SDLControllerWrapper/SDLControllerWrapper.csproj index 8f2a0a2..a5282ec 100644 --- a/SDLControllerWrapper/SDLControllerWrapper.csproj +++ b/SDLControllerWrapper/SDLControllerWrapper.csproj @@ -17,5 +17,6 @@ + - \ No newline at end of file +