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

meson: Use configuration_data() instead of piping variables through echo #30

Merged
merged 2 commits into from
Nov 6, 2023

Conversation

MarijnS95
Copy link
Contributor

Having a template file with replacement macros is a bit cleaner than encoding the setup of the file in meson.build and piping that through echo with caputred variables.

Unfortunately there appears to be no support for repetition, to e.g. expand a list of platform names into the various uses (array with comma-separation, or individual extern struct declarations, forcing us to have some form of string expansion within meson.build).

@lumag
Copy link
Collaborator

lumag commented Nov 6, 2023

I think platforms.c.in is missing

@MarijnS95
Copy link
Contributor Author

I think platforms.c.in is missing

Testing whether the CI could catch that 😏

platforms.c.in Outdated

@PLATFORM_DEFS@
const struct debugcc_platform *platforms[] = {
@PLATFORM_ARRAY@ NULL,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add a newline before NULL?

Copy link
Contributor Author

@MarijnS95 MarijnS95 Nov 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was just trying out whether to use '\n'.join() which intersperses (first push), then switched to += '...\n' which places it at the last entry and needs such hacks (see also no empty line between @PLATFORM_DEFS@ and const struct ...).

Not that it really matters, no-one should care about reading build/platform.c.in so we could have an empty line too-many either way.

… `echo`

Having a template file with replacement macros is a bit cleaner than
encoding the setup of the file in `meson.build` and piping that through
`echo` with caputred variables.

Unfortunately there appears to be no support for repetition, to e.g.
expand a list of platform names into the various uses (array with comma-
separation, or individual `extern struct` declarations, forcing us to
have some form of string expansion within `meson.build`).
@konradybcio konradybcio merged commit 132a037 into linux-msm:master Nov 6, 2023
12 checks passed
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.

3 participants