Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project>
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AssemblyVersion>3.0.0</AssemblyVersion>
<FileVersion>3.0.0</FileVersion>
<AssemblyVersion>3.0.0.1</AssemblyVersion>
<FileVersion>3.0.0.1</FileVersion>

<Nullable>enable</Nullable>
<NullableContextOptions>enable</NullableContextOptions>
Expand Down
10 changes: 8 additions & 2 deletions SDLControllerWrapper/DLLResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
3 changes: 2 additions & 1 deletion SDLControllerWrapper/SDLControllerWrapper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
<None Include="README.md" Pack="true" PackagePath="\" />
<None Include="..\build-native\linux-x64\*" Pack="true" PackagePath="runtimes\linux-x64\native" />
<None Include="..\build-native\win-x64\*" Pack="true" PackagePath="runtimes\win-x64\native" />
<None Include="..\build-native\osx-arm64\*" Pack="true" PackagePath="runtimes\osx-arm64\native" />
</ItemGroup>
</Project>
</Project>
Loading