danilwhale / Raylib-cs.BleedingEdge

C# binding for raylib, a simple and easy-to-use library to learn videogames programming
zlib License
3 stars 1 forks source link

Publish static libraries for NativeAOT #3

Open Ristovski opened 2 days ago

Ristovski commented 2 days ago

NativeAOT does not support IncludeNativeLibrariesForSelfExtract (https://github.com/dotnet/sdk/issues/39202), it would be nice if this project included a static library along with the shared one, so it could be statically linked into the final executable, allowing to publish single-file apps.

As it stands right now, this copies the libraylib.so next to the self-contained/NativeAOT binary.

Edit: Changing -D BUILD_SHARED_LIBS=ON to -D BUILD_SHARED_LIBS=OFF seems to Just Work(tm), so perhaps a build-time parameter can be implemented for dotnet build Raylib-cs.BleedingEdge.Native so that it can be invoked twice when building the resulting published package, once with the static lib and once with the shared one?

danilwhale commented 1 day ago

What about making 2 .Runtimes packages (.Shared and .Static) and 2 packages that reference .Shared or .Static and main package? I'm not really sure about this decision, but it's probably only a good one.

danilwhale commented 16 hours ago

Actually, I'll just make .CustomNative package, because it will be more useful.

danilwhale commented 3 hours ago

Sorry, but MSBuild is terrible to work with, you can now read README how to customize raylib build Also static libraries are now published in workflow