summaryrefslogtreecommitdiff
path: root/docs/markdown
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-11-27 00:32:34 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2017-11-27 20:50:04 +0200
commit3b3bceb85f8af89962e1c0d789b5c2d1234492dc (patch)
treeaef2af10e1a5fcf5d50f4dcafd486f49d2f345ae /docs/markdown
parentf70760a5108ac7802f5385fb5e7c15229bf5d5c8 (diff)
downloadmeson-iffound.tar.gz
Add if_found kwarg to subdir().iffound
Diffstat (limited to 'docs/markdown')
-rw-r--r--docs/markdown/Reference-manual.md8
-rw-r--r--docs/markdown/snippets/if-found.md13
2 files changed, 20 insertions, 1 deletions
diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md
index 2aa966586..fcfad32ca 100644
--- a/docs/markdown/Reference-manual.md
+++ b/docs/markdown/Reference-manual.md
@@ -1019,7 +1019,7 @@ has one argument the others don't have:
### subdir()
``` meson
- void subdir(dir_name)
+ void subdir(dir_name, ...)
```
Enters the specified subdirectory and executes the `meson.build` file
@@ -1032,6 +1032,12 @@ current build file and in all subsequent build files executed with
Note that this means that each `meson.build` file in a source tree can
and must only be executed once.
+This function has one keyword argument.
+
+ - `if_found` takes one or several dependency objects and will only
+ recurse in the subdir if they all return `true` when queried with
+ `.found()`
+
### subproject()
``` meson
diff --git a/docs/markdown/snippets/if-found.md b/docs/markdown/snippets/if-found.md
new file mode 100644
index 000000000..a8d4932c3
--- /dev/null
+++ b/docs/markdown/snippets/if-found.md
@@ -0,0 +1,13 @@
+# Added `if_found` to subdir
+
+Added a new keyword argument to the `subdir` command. It is given a
+list of dependency objects and the function will only recurse in the
+subdirectory if they are all found. Typical usage goes like this.
+
+ d1 = dependency('foo') # This is found
+ d2 = dependency('bar') # This is not found
+
+ subdir('somedir', if_found : [d1, d2])
+
+In this case the subdirectory would not be entered since `d2` could
+not be found.