Use new Cargo features and resolver to enable feature-based inclusion of crates (#522)
* Adds a dedicated `theseus_features` crate used for specifying "global" features across all of the Theseus workspace. This enables specifying which crates are optional in a Theseus build and thus which ones can be included via Cargo features. This works in cooperation with a `default-members` list, which species what subset of the members crates should be built by default when `--all` or `--workspace` is not passed to a `cargo build` invocation. * Solves the previous problem of it being difficult to exclude application or kernel crates from a Theseus build. You had to either manually remove them from the set of workspace members or add it to the set of workspace excludes. * By default, the current `Makefile` still builds all crates via the `--workspace` flag being the default `CARGOFLAGS` value when no other value for `CARGOFLAGS` is specified on the `make` command line invocation. * To actually use this new build functionality, simply set `CARGOFLAGS` with the features corresponding to the optional crates you wish to build: ``` make CARGOFLAGS="--features 'feat1 feat2 feat3' " ## spacing for emphasis ``` This enables three features, `feat1`, `feat2`, and `feat3`, and the ensuing build would include four things: 1. The nano_core and all of its dependencies 2. The crate(s) selected by feat1 and all of it's dependencies 3. The crate(s) selected by feat2 and all of it's dependencies 4. The crate(s) selected by feat3 and all of it's dependencies * Note: you can also just manually invoke `cargo build --features <...>` but then you'd also have to pass all of the other required arguments that Theseus's Makefile passes to cargo/rustc. f0d212ce811e8bf85d8083b757adf0cf691d3cfc
K
kevinaboos committed
b8ffc0b0e0541f230f2e36fcd482eeb7a4cd35bc
Parent: 06a4f7e