meta-rust / cargo-bitbake

cargo extension that can generate BitBake recipes utilizing the classes from meta-rust
Apache License 2.0
83 stars 57 forks source link

Unclear where to pass build args to Cargo #51

Closed cletustboone closed 2 years ago

cletustboone commented 2 years ago

The generated recipe never actually invokes cargo directly, so where is that done?

I'd like to be able to pass --features "feat1, feat2, feat3" when the code is actually built. This is probably due to my lack of understanding of Yocto in general. Where should I be passing feature flags for conditional compilation? Is this outside the scope of cargo bitbake?

cesar-pa commented 2 years ago

You can do it adding a .inc file to your layer that includes your features like this:

CARGO_BUILD_FLAGS += " --features feat1"
cletustboone commented 2 years ago

I've verified this works, by the way. Closing the issue unless it's better to leave it open for others with the same question.