This repository has been archived by the owner on Jan 6, 2023. It is now read-only.
Update target checks to support cross-compilation #73
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently miniaudio-sys/build.rs uses the
cfg!
macro to determine the platform flags, but it seems like those values are not accurate forbuild.rs
scripts. I think it's' implied by this part of the Cargo docs:This PR swaps the
cfg!
macro for the environment variables mentioned in the book. In my project, I encountered this when trying to cross-compile for wasm32 from macOS. Before the change, setting--target
would have no effect on the miniaudio flags: I would still seecargo:rustc-cfg=feature="ma-enable-coreaudio"
in the build log for instance. Now, when I target wasm32/emscripten, I see that the-webaudio
is enabled and-coreaudio
is not.I see that you have a CI GitHub workflow, but please let me know if there's any other testing you'd like to see. I lifted the implementation from https://github.com/paritytech/rust-snappy/blob/1195dfa43e1e9b69464d5105d65ceea2619331c7/snappy-sys/build.rs#L26-L28
Fixes #39.