Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

build: convert protocol variables to dicts #1963

Closed
emersion opened this issue Dec 22, 2019 · 1 comment · Fixed by #2129
Closed

build: convert protocol variables to dicts #1963

emersion opened this issue Dec 22, 2019 · 1 comment · Fixed by #2129

Comments

@emersion
Copy link
Member

I'd prefer to have a dict instead (e.g. protocols_code.get(name) would return the file for the generated code for instance).

That's actually a pretty good idea. Unfortunately meson (0.52.1) can't use a non string literal for a dictionary key:

protocol_code = {}
foreach proto, path : protocols
    # ...
    protocol_code += { proto: code } # This is invalid
endforeach

And due to the way dictionaries work (i.e. they're pure) and some dictionary-of-dictionaries type stuff, I can't really think of a way to work around this (e.g. putting it in the protocols dictionary).

But this will be fixed in 0.53.0: https://mesonbuild.com/Syntax.html#dictionaries
It has been left as set_variable/get_variable currently, but changed to use an array of protocol strings in the wayland backend.
I think this should be revisited when the next meson version is out and we eventually target it for whatever reason.

Originally posted by @ascent12 in #1931

@emersion
Copy link
Member Author

emersion commented Apr 4, 2020

When we bump to 0.53, we'll also be able to use summary instead of message.

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

Successfully merging a pull request may close this issue.

1 participant