> > > A Python script could parse compile_commands.json, add -E -DQEMU_MODINFO > > > to > > > the command-line option, and look in the output for the metadata. > > > > Hmm, worth trying, although I guess it would be easier to code this up > > straight in meson.build and pull the information you need out of the > > source set, especially as you'll know then which source files are > > compiled into which module. > > Hmm, looks like I actually need both. Seems there is no easy way to get > the cflags out of a source_set to construct a cpp command line. Pulling > this out of compile_commands.json with jq works though.
Well, easy until I look at target-specific modules where the "source file" -> "command" mapping isn't unique any more. Which makes this route less attractive ... Any idea on getting the cflags in meson.build Or maybe I can somehow ask meson to run the cpp pass only for a given source set? thanks, Gerd