-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically download raylib during raylib-sys
's build
#6
Conversation
Thank you @tangmi for your contribution! This looks pretty nice from what I can see. One potential issue I can foresee is when Another way to download a file on Windows is to go through PowerShell, which comes preinstalled since Windows 7 SP1 according to MS. This is, in fact, the way that the As for generating the bindings, this is certainly possible since For building raylib from source, I would also welcome such a feature, as long as it, too, is behind a feature flag, for the same reason above in not assuming a C compiler. |
FWIW this branch worked brilliantly out of the box on Mac OS. Received a single warning during
Warning is easily fixed by commenting out the |
@deltaphc I'm trying to wrap my head around a nice way to deliver a good user experience... It'd be awesome if we could pull down a pre-build package (if on a supported platform) using some method available on each platform. If we could somehow check if there is a C compiler available (or maybe just have a documented feature flag), we could pull down the source and compile it on unsupported (i.e. no official prebuild release) platforms (I have another branch prototyping what this could look like). Good find on the An aside on feature flags: raylib's architecture shows there are 7 core modules and 6 "extra" modules... I'm wondering if each of these modules would be good candidates to be put behind feature flags. Then, for instance, someone could pull down your package to use just the Edit: I just realized that to build Rust on Windows, one either needs the VC++ Build Tools for the |
It does imply that, because that is, in fact, what the compiler uses to build code for Windows afaik. |
You can probably assume that the |
Do you think it's reasonable to have the build step attempt the following (in order):
Option number 2 might just add complexity to the build script (and not be necessary) as both 2 and 3 require a compiler in path and 3 works on "every" platform. I don't think |
With 0.11 this is no longer necessary |
Updates from_euler arg order to match raymath's QuaternionFromEuler
Hi there! I'm very happy that I found your Rust wrappers for raylib! Please treat this PR just as a proposal. If the idea is good, it can be cleaned up.
I've implemented a
build.rs
script for theraylib-sys
package that downloads the correct raylib library for one's current platform/architecture/environment (or fails if there's no existing pre-built download and raylib doesn't already exist in the library search path).The main idea here is to reduce the barrier to entry to making a 3d game in Rust to "just add
raylib = "..."
to yourCargo.toml
(on any platform) and everything will set itself up for you"Some things that can definitely be improved:
.tar.gz
implies "unix" and.zip
implies "windows". This is currently true for the current release, but doesn't have to beffi_*.rs
bindings at build time since these changes make theraylib.h
header download locally.Edit: I've only tested this on windows, so there's probably additional work to ensure it works on macos and linux...