diff options
author | Martin Ejdestig <marejde@gmail.com> | 2019-02-23 18:41:39 +0100 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-02-26 19:19:43 +0200 |
commit | 67a01c8d7fc8a4e1c237329ecad4af162186b4ba (patch) | |
tree | eee29121ceba4a020e28fe5ba22b8b34535b0d6a /docs/markdown/Generating-sources.md | |
parent | 32a344b9497ec90d31179cc3a0b385aa2a5f691c (diff) | |
download | meson-67a01c8d7fc8a4e1c237329ecad4af162186b4ba.zip meson-67a01c8d7fc8a4e1c237329ecad4af162186b4ba.tar.gz meson-67a01c8d7fc8a4e1c237329ecad4af162186b4ba.tar.bz2 |
Improve declare_dependency() example in Generating-sources.md [skip ci]
By using private_dir_include() instead of enumerating headers in sources
of declare_dependency. Much more convenient, especially when there are
many headers.
Found out about this by reading #4638. It is not documented anywhere as
far as I can tell.
Diffstat (limited to 'docs/markdown/Generating-sources.md')
-rw-r--r-- | docs/markdown/Generating-sources.md | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/docs/markdown/Generating-sources.md b/docs/markdown/Generating-sources.md index 306bee3..ef7d5ac 100644 --- a/docs/markdown/Generating-sources.md +++ b/docs/markdown/Generating-sources.md @@ -111,11 +111,16 @@ and library dependency, especially if there are many generated headers: ```meson idep_foo = declare_dependency( - sources : [foo_h, bar_h], + include_directories : libfoo.private_dir_include(), link_with : [libfoo], ) ``` +Adding the static library's private include directory to +`include_directories` of `declare_dependency` will make sure all headers +are generated before any sources of a target linking against libfoo are +built. + See [dependencies](Dependencies.md#declaring-your-own), and [reference](Reference-manual.md#decalre_dependency) for more information. |