diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2019-07-10 00:05:51 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2019-07-10 00:05:51 +0530 |
commit | 609a2bf1664bd2445f4bb84a81262e27acebf01c (patch) | |
tree | f586eb4e561bd525c19780fbdb06e7f020ae2b80 | |
parent | 639df5721703c90723f5ca1ae09b84865b30278d (diff) | |
download | meson-nirbheek/faq-generated-headers.tar.gz |
FAQ.md: Do I need to add headers to sources? [skip ci]nirbheek/faq-generated-headers
-rw-r--r-- | docs/markdown/FAQ.md | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/markdown/FAQ.md b/docs/markdown/FAQ.md index cd52f40ab..06379aec7 100644 --- a/docs/markdown/FAQ.md +++ b/docs/markdown/FAQ.md @@ -403,6 +403,24 @@ kwarg to `''` and the [`name_suffix:`](https://mesonbuild.com/Reference-manual.h kwarg to `'lib'`. To get the default behaviour for each, you can either not specify the kwarg, or pass `[]` (an empty array) to it. +## Do I need to add my headers to the sources list like in Autotools? + +Autotools requires you to add private and public headers to the sources list so +that it knows what files to include in the tarball generated by `make dist`. +Meson's `dist` command simply gathers everything committed to your git/hg +repository and adds it to the tarball, so adding headers to the sources list is +pointless. + +Meson uses Ninja which uses compiler dependency information to automatically +figure out dependencies between C sources and headers, so it will rebuild +things correctly when a header changes. + +The only exception to this are generated headers, for which you must [declare +dependencies correctly](#how-do-i-tell-meson-that-my-sources-use-generated-headers). + +If, for whatever reason, you do add non-generated headers to the sources list +of a target, Meson will simply ignore them. + ## How do I tell Meson that my sources use generated headers? Let's say you use a [`custom_target()`](https://mesonbuild.com/Reference-manual.html#custom_target) |