I am trying to figure out how to use generator() and/or custom_target().
I have an IDL compiler that reads a .idl file and generates a .h file. Each .idl file is also paired with a .user-created .c file. That .c file (and others) include the generated .h file.
I created a generator like this:
idl2c = generator(
idl2c_exe,
output: ['@BASENAME@.h'],
arguments: ['-O@BUILD_DIR@', '@INPUT@']
)
The idea would be to have lines like this in my build.meson files:
idl2c.process('foo.idl', 'bar.idl', 'baz.idl', <and more>)
But that does not do anything, I believe that is because nothing depends upon the output from idl2c.process(). I have tried creating a custom_target that uses idl2c.process() but have gotten nowhere.
In addition, the doc says that each output will be created in a target-private directory @BUILD_DIR@. But I need this output to be in a non-target-private directory so that all of the .c files can locate the generated .h file.
There are hundreds of .idl files, so I do not want to create a custom_target for each one.
Where do I go from here?