From 10708676ade79037f2d2ceeb98500a40a977abef Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Sun, 25 Sep 2022 13:51:07 -0400 Subject: 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 --- docs/markdown/Gnome-module.md | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'docs/markdown') 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, -- cgit v1.1