diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2019-07-10 00:05:51 +0530 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-07-10 01:00:42 +0300 |
commit | a310ba863e4104178d509c2c920d12fd391f6a84 (patch) | |
tree | f586eb4e561bd525c19780fbdb06e7f020ae2b80 /docs/markdown/FAQ.md | |
parent | 2cc9d79e95cc6d09e6693b9e5e54c40b05bf6532 (diff) | |
download | meson-a310ba863e4104178d509c2c920d12fd391f6a84.zip meson-a310ba863e4104178d509c2c920d12fd391f6a84.tar.gz meson-a310ba863e4104178d509c2c920d12fd391f6a84.tar.bz2 |
FAQ.md: Do I need to add headers to sources? [skip ci]
Diffstat (limited to 'docs/markdown/FAQ.md')
-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 cd52f40..06379ae 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) |