aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorbehlec <33778676+behlec@users.noreply.github.com>2018-03-29 20:29:45 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2018-03-29 21:29:45 +0300
commit37d379ebe5ebf935297fe18478dfa311afa64d24 (patch)
tree04464fc8a034e978f022a424719901e2d056aa43 /docs
parent6146353f454a6db709309ad47798df87462097c9 (diff)
downloadmeson-37d379ebe5ebf935297fe18478dfa311afa64d24.zip
meson-37d379ebe5ebf935297fe18478dfa311afa64d24.tar.gz
meson-37d379ebe5ebf935297fe18478dfa311afa64d24.tar.bz2
Allow meson build file to exit early. (#2808)
Diffstat (limited to 'docs')
-rw-r--r--docs/markdown/Reference-manual.md27
-rw-r--r--docs/markdown/Release-notes-for-0.46.0.md7
2 files changed, 34 insertions, 0 deletions
diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md
index 54b7131..5109b25 100644
--- a/docs/markdown/Reference-manual.md
+++ b/docs/markdown/Reference-manual.md
@@ -1129,6 +1129,33 @@ This function has one keyword argument.
recurse in the subdir if they all return `true` when queried with
`.found()`
+### subdir_done()
+
+``` meson
+ subdir_done()
+```
+
+Stops further interpretation of the meson script file from the point of
+the invocation. All steps executed up to this point are valid and will
+be executed by meson. This means that all targets defined before the call
+of `subdir_done` will be build.
+
+If the current script was called by `subdir` the execution returns to the
+calling directory and continues as if the script had reached the end.
+If the current script is the top level script meson configures the project
+as defined up to this point.
+
+Example:
+```meson
+project('example exit', 'cpp')
+executable('exe1', 'exe1.cpp')
+subdir_done()
+executable('exe2', 'exe2.cpp')
+```
+
+The executable `exe1` will be build, while the executable `exe2` is not
+build.
+
### subproject()
``` meson
diff --git a/docs/markdown/Release-notes-for-0.46.0.md b/docs/markdown/Release-notes-for-0.46.0.md
index 395a94d..e062459 100644
--- a/docs/markdown/Release-notes-for-0.46.0.md
+++ b/docs/markdown/Release-notes-for-0.46.0.md
@@ -14,3 +14,10 @@ whose contents should look like this:
## Feature name
A short description explaining the new feature and how it should be used.
+
+## Allow early return from a script
+
+Added the function `subdir_done()`. Its invocation exits the current script at
+the point of invocation. All previously invoked build targets and commands are
+build/executed. All following ones are ignored. If the current script was
+invoked via `subdir()` the parent script continues normally.