I would like to extract some defines from header files, and put the result into a meson variables. I can of course do that with run_command
, forming a shell command of cpp, sed and so on. But I wonder if meson gives some automation to that task. Having run_preprocessor
would already be a win, but there seem to be no such
thing. Also get_compiler
method does exist, but get_preprocessor
- seemingly not. At least I could refer to a currently selected preprocessor
and use the current include paths, rather than just using cpp
in run_command
with a hard-coded path to headers.
Does meson provide at least some help for extracting things from headers, or should it be coded by hands, with a pure run_command
?
Based on @dcbaker reply, I've come up with this: