diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2022-04-27 23:45:02 -0400 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2022-04-27 23:45:02 -0400 |
commit | c181f2c70bd606f0100f74844fcf9697be16c217 (patch) | |
tree | ca45adb4585573964c0c1843ca56856334b97ef4 /docs/markdown | |
parent | df3f064c81cf9053a2ba9fa7b62298de6c5d7625 (diff) | |
download | meson-c181f2c70bd606f0100f74844fcf9697be16c217.zip meson-c181f2c70bd606f0100f74844fcf9697be16c217.tar.gz meson-c181f2c70bd606f0100f74844fcf9697be16c217.tar.bz2 |
Add small note that get_variable can publicize its data files
Nothing elaborate, just laying down the ground rules for expected usage
and pointing out that it now works. The idea is not to give people
ideas, but to let projects which already have this use case, use it with
confidence.
Diffstat (limited to 'docs/markdown')
-rw-r--r-- | docs/markdown/Dependencies.md | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/docs/markdown/Dependencies.md b/docs/markdown/Dependencies.md index 15da929..a3e5a00 100644 --- a/docs/markdown/Dependencies.md +++ b/docs/markdown/Dependencies.md @@ -90,6 +90,28 @@ following will happen: If 'default_value' was provided that value will be returned, if 'default_value' was not provided then an error will be raised. +## Dependencies that provide resource files + +Sometimes a dependency provides installable files which other projects then +need to use. For example, wayland-protocols XML files. + +```meson +foo_dep = dependency('foo') +foo_datadir = foo_dep.get_variable('pkgdatadir') +custom_target( + 'foo-generated.c', + input: foo_datadir / 'prototype.xml', + output: 'foo-generated.c', + command: [generator, '@INPUT@', '@OUTPUT@'] +) +``` + +*Since 0.63.0* these actually work as expected, even when they come from a +(well-formed) internal dependency. This only works when treating the files to +be obtained as interchangeable with a system dependency -- e.g. only public +files may be used, and leaving the directory pointed to by the dependency is +not allowed. + # Declaring your own You can declare your own dependency objects that can be used |