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

build: Use syn to pick out constants #49

Merged
merged 1 commit into from
Oct 20, 2023
Merged

build: Use syn to pick out constants #49

merged 1 commit into from
Oct 20, 2023

Conversation

chrysn
Copy link
Member

@chrysn chrysn commented Feb 22, 2023

As #48 has shown, picking flags out of the bindgen output is relatively brittle. It worked well for as long as we were only checking for some string's presence, but for CONFIG_ things we need a bit more.

This just uses the syn parser to parse the source code; that's a well established tool that's also used in proc macros.

Leaving this as a draft for a while to gather input and think more about it, but so far I like it.

@chrysn chrysn merged commit 0cf9a84 into main Oct 20, 2023
2 checks passed
@chrysn chrysn deleted the parse-cfg-through-syn branch October 20, 2023 13:23
@chrysn
Copy link
Member Author

chrysn commented Oct 20, 2023

Merged after it still builds well with current master and some RIOT/Rust versions in.

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

Successfully merging this pull request may close these issues.

1 participant