aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2019-05-08 17:22:56 +0100
committerJon Turney <jon.turney@dronecode.org.uk>2020-02-09 16:01:34 +0000
commit7a159ff1e1e947f20a017bbc8e89c1701a9d7098 (patch)
treea1a6d10b43d4de46e139ae25e7f8956f69b57f14 /docs/markdown
parent31d89a4ed24987658b0caf8b7fe1e1c0df01ecfb (diff)
downloadmeson-7a159ff1e1e947f20a017bbc8e89c1701a9d7098.zip
meson-7a159ff1e1e947f20a017bbc8e89c1701a9d7098.tar.gz
meson-7a159ff1e1e947f20a017bbc8e89c1701a9d7098.tar.bz2
Add add_languages(native:)
v2: Retain not using logical-and, to avoid short-circuiting side-effects of add_languages()
Diffstat (limited to 'docs/markdown')
-rw-r--r--docs/markdown/Reference-manual.md24
-rw-r--r--docs/markdown/snippets/native_compiler_not_required.md5
2 files changed, 20 insertions, 9 deletions
diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md
index 510d443..3b07b5f 100644
--- a/docs/markdown/Reference-manual.md
+++ b/docs/markdown/Reference-manual.md
@@ -54,9 +54,9 @@ Like `add_global_arguments` but the arguments are passed to the linker.
bool add_languages(*langs*)
```
-Add support for new programming languages. Equivalent to having them
-in the `project` declaration. This function is usually used to add
-languages that are only used on some platforms like this:
+Add programming languages used by the project. Equivalent to having them in the
+`project` declaration. This function is usually used to add languages that are
+only used under some conditions, like this:
```meson
project('foobar', 'c')
@@ -68,12 +68,18 @@ if add_languages('cpp', required : false)
endif
```
-Takes one keyword argument, `required`. It defaults to `true`, which
-means that if any of the languages specified is not found, Meson will
-halt. Returns true if all languages specified were found and false
-otherwise. Since *0.47.0* the value of a
-[`feature`](Build-options.md#features) option can also be passed to
-the `required` keyword argument.
+Takes the following keyword arguments:
+
+- `required` defaults to `true`, which means that if any of the languages
+specified is not found, Meson will halt. Since *0.47.0* the value of a
+[`feature`](Build-options.md#features) option can also be passed.
+
+- `native` if set to `true`, the language will be used to compile for the build
+ machine, if `false`, for the host machine. If omitted, the language may be
+ used for either. Since *0.54.0*. The default may change to `false` in a future
+ meson version.
+
+Returns `true` if all languages specified were found and `false` otherwise.
### add_project_arguments()
diff --git a/docs/markdown/snippets/native_compiler_not_required.md b/docs/markdown/snippets/native_compiler_not_required.md
new file mode 100644
index 0000000..0847b2b
--- /dev/null
+++ b/docs/markdown/snippets/native_compiler_not_required.md
@@ -0,0 +1,5 @@
+## Native (build machine) compilers not always required
+
+`add_languages()` gained a `native:` keyword, indicating if a native or cross
+compiler is to be used. Currently, for backwards compatibility, if the keyword
+is absent, that means both are used.