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
11 changes: 10 additions & 1 deletion .github/workflows/buildZMusic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ jobs:
cmakeargscommon: -DMPG123_INCLUDE_DIR:PATH="D:/a/ZMusicWrapper/ZMusicWrapper/vcpkg/installed/x64-windows-static/include" -DSNDFILE_LIBRARY:FILEPATH="D:/a/ZMusicWrapper/ZMusicWrapper/vcpkg/installed/x64-windows-static/lib/sndfile.lib" -DMPG123_LIBRARY:FILEPATH="D:/a/ZMusicWrapper/ZMusicWrapper/vcpkg/installed/x64-windows-static/lib/mpg123.lib" -DSNDFILE_INCLUDE_DIR:PATH="D:/a/ZMusicWrapper/ZMusicWrapper/vcpkg/installed/x64-windows-static/include" -DCMAKE_SHARED_LINKER_FLAGS:STRING="/machine:x64 /LIBPATH:D:/a/ZMusicWrapper/ZMusicWrapper/deps" -DCMAKE_CXX_STANDARD_LIBRARIES:STRING="kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib FLAC.lib FLAC++.lib libmp3lame-static.lib libmpghip-static.lib ogg.lib opus.lib out123.lib syn123.lib vorbis.lib shlwapi.lib" -DDYN_SNDFILE:BOOL="0" -DDYN_MPG123:BOOL="0"
linkerfiles: ZMusic/build/source/Release/zmusic.lib deps/*.lib
libfiles: ZMusic/build/source/Release/zmusic.dll
- os: macos-latest
rid: osx-arm64
prereqs: |
brew install libsndfile mpg123
cmakeargsdynamic: -B build
cmakeargsstatic: -B build -DLIBTYPE=STATIC -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE -DBUILD_SHARED_LIBS=OFF
cmakeargscommon: -DDYN_SNDFILE:BOOL="0" -DDYN_MPG123:BOOL="0"
linkerfiles: ZMusic/build/source/libzmusic.a
libfiles: ZMusic/build/source/libzmusic.dylib
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -96,4 +105,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: ZMusicWrapper
path: build_managed
path: build_managed
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 ZMusicWrapper/ZMusic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,20 @@ public unsafe partial class ZMusic
? 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()
? ["libzmusic.so", "zmusic.so"]
: OperatingSystem.IsWindows()
? ["zmusic.dll", "libzmusic.dll"]
: throw new NotSupportedException("Unsupported OS platform");
: OperatingSystem.IsMacOS()
? ["zmusic.dylib", "libzmusic.dylib"]
: throw new NotSupportedException("Unsupported OS platform");

public static string? LoadedFilePath => m_loadedFileName;

Expand Down
1 change: 1 addition & 0 deletions ZMusicWrapper/ZMusicWrapper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,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>
Loading