You can add include directories directly to generator() arguments:
idl_generator = generator(idl_compiler,
output : '@BASENAME@.h',
arguments : [
'-h',
'-o', '@OUTPUT@',
'-I', '@0@/src/'.format(meson.current_source_dir()),
'@INPUT@' ])
I added -I option which according to docs can be used to
Add a header search directory to path. Multiple search directories are
allowed.
and used meson's string formatting together with meson's object method current_source_dir() which
returns a string to the current source directory.
Note also that output argument is string, not list.
Or, for example, if you have several of them and need to use them as dependency later, you can have array:
my_inc_dirs = ['.', 'include/xxx', 'include']
generate args for generator:
idl_gen_args = [ '-h', '-o', '@OUTPUT@', '@INPUT@' ]
foreach dir : my_inc_dirs
idl_gen_args += ['-I', '@0@/@1@'.format(meson.current_source_dir(), dir)]
endforeach
idl_generator = generator(idl_compiler,
output : '@BASENAME@.h',
arguments : idl_gen_args)
and use later for dependency:
my_exe = executable(
...
include_directories : [my_inc_dirs],
...)