diff options
| author | Daniel Mensinger <daniel@mensinger-ka.de> | 2021-08-21 16:27:56 +0200 |
|---|---|---|
| committer | Daniel Mensinger <daniel@mensinger-ka.de> | 2021-10-03 11:46:34 +0200 |
| commit | 2b482e39a90fa1929e0fa4006861f4264f28adb2 (patch) | |
| tree | 0af5ef229d25bef1b974445406fc3c9d28c0756f /docs/yaml/functions/add_languages.yaml | |
| parent | ad65a699f93a7659739287882ca27c58c564670b (diff) | |
| download | meson-2b482e39a90fa1929e0fa4006861f4264f28adb2.tar.gz | |
docs: Add the YAML Reference manual
Diffstat (limited to 'docs/yaml/functions/add_languages.yaml')
| -rw-r--r-- | docs/yaml/functions/add_languages.yaml | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/docs/yaml/functions/add_languages.yaml b/docs/yaml/functions/add_languages.yaml new file mode 100644 index 000000000..6851c4e00 --- /dev/null +++ b/docs/yaml/functions/add_languages.yaml @@ -0,0 +1,51 @@ +name: add_languages +returns: bool +description: | + Add programming languages used by the project. + + This is equivalent to having + them in the `project` declaration. This function is usually used to + add languages that are only used under some conditions. + + Returns `true` if all languages specified were found and `false` otherwise. + + If `native` is omitted, the languages may be used for either build or host + machine, but are never required for the build machine. (i.e. it is equivalent + to `add_languages(*langs*, native: false, required: *required*) and + add_languages(*langs*, native: true, required: false)`. This default behaviour + may change to `native: false` in a future Meson version. + +example: | + ```meson + project('foobar', 'c') + + if compiling_for_osx + add_languages('objc') + endif + if add_languages('cpp', required : false) + executable('cpp-app', 'main.cpp') + endif + + # More code... + ``` + +varargs: + type: str + name: Language + description: The languages to add + +kwargs: + required: + type: bool + default: true + description: | + If set to `true`, Meson will halt if any of the languages + specified are not found. *(since 0.47.0)* The value of a + [`feature`](Build-options.md#features) option can also be passed. + native: + type: bool + since: 0.54.0 + description: | + If set to `true`, the language will be used to compile for the build + machine, if `false`, for the host machine. + |
