On 4/14/23 1:50 PM, Max-Julian Pogner wrote:
> Hello!
>
> i have searches the
mesonbuild.com homepage, and any other meson howto i
> could find via google, but to no avail. The actual globbing seems not
> possible, even outside a custom_target.
>
>
> I have a custom_target, where the 'input' argument should be (the list
> of) every file in a src/template/ directory.
> At the moment i found only the option to manually list all the files,
> which i want to avoid.
>
> However, what i would like to do is some kind of globbing, where i can
> tell meson that "every file in src/template/" is an input.
Here is an argument against the use of wildcards/globbing:
https://mesonbuild.com/FAQ.html#why-cant-i-specify-target-files-with-a-wildcard
Here is a description of how you can do it anyway, along with the caveats:
https://mesonbuild.com/FAQ.html#but-i-really-want-to-use-wildcards
> What i like to achieve with this is, that a change to any of these input
> files will tell meson that this custom_target needs to be re-executed,
> and if all files remain unchanged, that the previous execution can be
> re-used.
I am not certain what you mean by this, since a custom_target doesn't
get "executed", but rather "built".
Changes to the file *contents* of files which are evaluated as build
inputs will always, no matter what, result in the `command:` being rerun
to rebuild that target.
The use of globbing doesn't change that -- globbing only affects the
list of file *names* which are evaluated as build inputs.
--
Eli Schwartz