diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2022-09-25 13:51:07 -0400 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2023-09-09 21:28:22 -0400 |
commit | 10708676ade79037f2d2ceeb98500a40a977abef (patch) | |
tree | dfe1175738d365c8476df7a629324432543cbb39 /docs | |
parent | 5f46ea116c6f80edd3633c03aacd7427ef3d0cec (diff) | |
download | meson-10708676ade79037f2d2ceeb98500a40a977abef.zip meson-10708676ade79037f2d2ceeb98500a40a977abef.tar.gz meson-10708676ade79037f2d2ceeb98500a40a977abef.tar.bz2 |
gnome.mkenum_simple(): Fix include path when header is in subdir
It was generating #include with the basename of every header file. That
assumes that every directory where there are headers are also included
into search path when compiling the .c file.
Change to use path relative to current subdir, which can be both in
build or source directory. That means that we assume that when the .c
file is compiled, the target has a include_directories pointing to the
directory where gnome.mkenum_simple() has been called, which is
generally '.' and added automatically.
Also fix type annotation to only allow str and File sources, other types
have never been working, it would require to iterate over custom target
outputs, etc.
Fixes: #7582
Diffstat (limited to 'docs')
-rw-r--r-- | docs/markdown/Gnome-module.md | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/docs/markdown/Gnome-module.md b/docs/markdown/Gnome-module.md index d0cd24a..013e8c8 100644 --- a/docs/markdown/Gnome-module.md +++ b/docs/markdown/Gnome-module.md @@ -204,6 +204,13 @@ for a build target, you must add the generated header to the build target's list of sources to codify the dependency. This is true for all generated sources, not just `mkenums_simple`. +The generated source file includes all headers passed to the sources keyword +argument, using paths relative to current build or source directory. That means +that targets that compile the generated source file must have the current +directory in its `include_directories`. *Since 1.3.0* `sources` outside of +current directory do not require adding those directories into +`include_directories` anymore. + * `body_prefix`: additional prefix at the top of the body file, e.g. for extra includes * `decorator`: optional decorator for the function declarations, |