How to add location of generated include files to include directories?

1,582 views
Skip to first unread message

Gzp

unread,
Mar 11, 2016, 7:18:58 PM3/11/16
to The Meson Build System
I'm generating some header files for one of my library using a python script. It is working fine and files are generated under math@sta. (value of @OUTPUT@) I wish to include them in another library, but math@sta does not seems to be added to the include list.

prg_genswizzle = find_program( 'genswizzle.py' )

gen_swizzle_code
= generator( prg_genswizzle,
    output
: '@BASE...@swizzle.ipp',
    arguments
: ['@OUTPUT@', '@EXTRA_ARGS@', 'code'] )

vector2swizzle
= gen_swizzle_code.process('vector2.hpp', extra_args : ['2'])


I've tried to add both '.' and current_build_dir, but the directory was not added:
incmath = include_directories( meson.current_build_dir(), '.' )
dep_math
= declare_dependency(
    include_directories
: [incdir_engine,incmath],
    link_with
: [lib_math],
)


What am i missing ? Should I use meson.current_build_dir() + 'filename.hpp' during generation instead of OUTPUT?
What is the proper way to generate headers without any input dependency ? (In this case vector2.hpp is not required at all, it is just a placeholder)
I've found multiple solutions, but each requires an input
- generator
- configure_file (requires input too)
- custom_target
- run_command (not a good choice as invoked only during meson configuration)

Jussi Pakkanen

unread,
Mar 12, 2016, 10:30:26 AM3/12/16
to Gzp, The Meson Build System
On Sat, Mar 12, 2016 at 2:18 AM, Gzp <z.p.gaa...@gmail.com> wrote:
 
I've tried to add both '.' and current_build_dir, but the directory was not added:

The reference manual (https://github.com/mesonbuild/meson/wiki/Reference%20manual) sayeth the following:

build target object
...
- private_dir_include returns a opaque object that works like include_directories but points to the private directory of this target, usually only needed if an another target needs to access some generated internal headers of this target

Reply all
Reply to author
Forward
0 new messages