Raylib-cs icon indicating copy to clipboard operation
Raylib-cs copied to clipboard

Build raylib native library locally

Open anggape opened this issue 2 years ago • 10 comments

before this changes we don't know if our change is working without copying native library manually, this pr download build native library and copy that native library to output directory

i only test this on linux, this pr need testing on macos and windows

i will implement android build on #171 if this changes merged

anggape avatar Aug 13 '23 17:08 anggape

this required cmake

anggape avatar Aug 13 '23 17:08 anggape

This is interesting. It effectively moves/duplicates the GitHub Action for building native raylib into the .csproj.

I think there is a place for this in the repo, this could be very useful, but I don't think it should be implicitly or done automatically, on build of the main project.

Maybe put this in an empty project Raylib-cs.Native with a readme.md explaining why?

If we are going to do this, then the duplicate code in the GH Action needs to be removed.

One thing I do agree with, is that this is a much better way of maintaining custom build/environment flags then hidden in the .github folder

9ParsonsB avatar Aug 14 '23 01:08 9ParsonsB

should i create new Raylib-cs.Native package and move native library there? and maybe turn Raylib-cs package into metapackage so user can use custom native library, this would make #169 possible

anggape avatar Aug 14 '23 02:08 anggape

so my idea is Raylib-cs reference Raylib-cs.Core and Raylib-cs.Native similar to Microsoft.AspNetCore.All Raylib-cs.Core previously Raylib-cs Raylib-cs.Native only contains native libraries

so when user want to build custom native library they need to install Raylib-cs.Core and get Raylib-cs.Native source code and build it locally

anggape avatar Aug 14 '23 02:08 anggape

@anggape Just added Raylib-cs.Native.csproj using your pr build changes. Feel free to add android build changes to this.

rgebee avatar Aug 23 '23 14:08 rgebee

the problem with this implementations is we need to download raylib source code for each target frameworks, is fine for ci environment such as github actions, but for slow internet like mine is gonna take long time to download raylib source, can we add raylib as submodule as well? this will resolve the problem since we dont need to download for each target frameworks

anggape avatar Aug 23 '23 14:08 anggape

seems like its become a problem on ci as well

error MSB3932: Failed to unzip file "obj/Release/net5.0/raylib.zip" because the file does not exist or is inaccessible.

https://github.com/ChrisDill/Raylib-cs/actions/runs/5952288439/job/16144511559

anggape avatar Aug 23 '23 14:08 anggape

@anggape Changed to just one framework. Unsure on the build error with cmake. https://github.com/ChrisDill/Raylib-cs/actions/runs/5952960115/job/16146279254

rgebee avatar Aug 23 '23 15:08 rgebee

Would it possible with this PR to disable even the recoding thing on F12?

MrScautHD avatar Sep 16 '23 15:09 MrScautHD

@anggape Considered submodules though makes setup more complex and pulls in raylib examples as well. Could include a copy of what we need instead? @9ParsonsB Any thoughts on this?

@MrScautHD Should be possible since it is a config option in raylib.

rgebee avatar Sep 21 '23 17:09 rgebee

Closing this since Raylib-cs.Native has been setup. Still experimental so I opened #235 to improve it and potentially make it part of the workflow.

rgebee avatar Apr 06 '24 09:04 rgebee