Skip to content
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

Output Cargo.toml dependencies and features #780

Open
Emilgardis opened this issue Nov 29, 2023 · 5 comments
Open

Output Cargo.toml dependencies and features #780

Emilgardis opened this issue Nov 29, 2023 · 5 comments

Comments

@Emilgardis
Copy link
Member

Should we have a way to make svd2rust output a [dependencies] and [features] given a set of arguments?

svd2rust cargo-toml --impl-defmt defmt -i STM32F30x.svd

would give

[dependencies]
critical-section = { version = "1.0", optional = true }
cortex-m = "0.7"
cortex-m-rt = { version = "0.7", optional = true }
vcell = "0.1"
defmt = { version = "0.3", optional = true }


[features]
rt = ["cortex-m-rt/device"]
defmt = ["dep:defmt"]
@Emilgardis
Copy link
Member Author

This is partly motivated by #728 where I'd want this

@burrbull
Copy link
Member

how you suggest to chose versions?

"*" ?

@burrbull
Copy link
Member

maybe then some --init-crate name instead that creates full-featured crate which we can just cargo build?

@Emilgardis
Copy link
Member Author

Yeah, I think using * in version could work, but there have been times (long time ago) where svd2rust didn't target latest release of a dependency. Doesn't happen often though, so * would be fine for me

@Emilgardis
Copy link
Member Author

I don't think a full Cargo.toml is good enough, since the changes you would do to the toml file wouldn't persist between runs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants