Re: How to use Meson (was: [PATCH 00/10] meson: wire up missing HTML documentation])
From: Toon Claes <hidden>
Date: 2025-01-03 07:58:22
Patrick Steinhardt [off-list ref] writes:
I don't really think it makes sense to explicitly point out every option that we have. We already document how to discover and set options, and from hereon it follows that you can wire up docs by running for example `meson setup -Ddocs=man ..`. It's just another option, and as such it can be discovered by running `meson configure`.
This is something I wasn't aware of. Because I'm used to the Makefile workflow and I'm not familiar with Meson, I didn't expect it to work like that.
The benefit of this is that it cannot grow stale like the build options in our Makefile. These may or may not have documentation, and may or may not be stale. With Meson, every build option is listed explicitly, has documentation and is discoverable via `meson configure`.
That's awesome, and I totally I agree we use the benefit of this self-documenting feature of Meson. Again, I didn't know about that. It's more of a me-problem than with your code.
Yup, you are always expected to set up the top-level source directory, not any of the subdirectories. The build instructions are then processed linearly in Meson, so variables declared before a call to `subdir()` would be accessible in the subdirectory, as well.
With Makefiles I can build individual targets (like `make docs`), or run `make` in the docs/ subdir, is something like that also possible with Meson? Or are you always configuring what to build in `meson configure` and building all that with `meson compile`? -- Toon