aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/markdown/Reference-manual.md8
-rw-r--r--docs/markdown/Subprojects.md24
2 files changed, 31 insertions, 1 deletions
diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md
index 4dc87c9..8d6f89c 100644
--- a/docs/markdown/Reference-manual.md
+++ b/docs/markdown/Reference-manual.md
@@ -661,6 +661,10 @@ Note that this function call itself does not add the directories into
the search path, since there is no global search path. For something
like that, see [`add_project_arguments()`](#add_project_arguments).
+See also `implicit_include_directories` parameter of
+[executable()](#executable), which adds current source and build directories
+to include path.
+
Each directory given is converted to two include paths: one that is
relative to the source root and one relative to the build root.
@@ -1134,6 +1138,8 @@ subproject. However, if you want to use a dependency object from
inside a subproject, an easier way is to use the `fallback:` keyword
argument to [`dependency()`](#dependency).
+[See additional documentation](Subprojects.md).
+
### test()
``` meson
@@ -1780,7 +1786,7 @@ opaque object representing it.
- `get_variable(name)` fetches the specified variable from inside the
subproject. This is useful to, for instance, get a [declared
- dependency](#declare_dependency) from the subproject.
+ dependency](#declare_dependency) from the [subproject](Subprojects.md).
### `run result` object
diff --git a/docs/markdown/Subprojects.md b/docs/markdown/Subprojects.md
index 0d1442e..ad2aae2 100644
--- a/docs/markdown/Subprojects.md
+++ b/docs/markdown/Subprojects.md
@@ -77,3 +77,27 @@ subproject `b` and have `b` also use `a`.
Meson ships with a dependency system to automatically obtain
dependency subprojects. It is documented in the [Wrap dependency
system manual](Wrap-dependency-system-manual.md).
+
+# Why must all subprojects be inside a single directory?
+
+There are several reasons.
+
+First of all, to maintain any sort of sanity, the system must prevent going
+inside other subprojects with `subdir()` or variations thereof. Having the
+subprojects in well defined places makes this easy. If subprojects could be
+anywhere at all, it would be a lot harder.
+
+Second of all it is extremely important that end users can easily see what
+subprojects any project has. Because they are in one, and only one, place,
+reviewing them becomes easy.
+
+This is also a question of convention. Since all Meson projects have the same
+layout w.r.t subprojects, switching between projects becomes easier. You don't
+have to spend time on a new project traipsing through the source tree looking
+for subprojects. They are always in the same place.
+
+Finally if you can have subprojects anywhere, this increases the possibility of
+having many different (possibly incompatible) versions of a dependency in your
+source tree. Then changing some code (such as changing the order you traverse
+directories) may cause a completely different version of the subproject to be
+used by accident.