Hi GN people!
In my project I'm building support for a number of different hardware versions of our firmware.
Each hardware version has a primary name, and that name maps to a unique integer (starting at 0, ascending). The integer is used both in the code as a -D definition, but then also as a build-time argument to other vendor-provided tools.
I'd love something like a map that I could simply import from a gni file into the various BUILD files that use it, but GN doesn't appear to have this. I could have the same cascading if/else logic everywhere, but that's not great when new hardware comes along.
I could do an exec_script into python and keep the dict in a central location, but exec_script isn't a feature we're supposed to sprint towards. So, before I do that, how do other people manage this? Are there any good patterns here?
Thanks in advance,
Charles