aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown/snippets
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2020-08-02 10:03:13 -0700
committerGitHub <noreply@github.com>2020-08-02 10:03:13 -0700
commit3040f3c8dc620152afea73066f0048c3bbeb7266 (patch)
tree683fd1aaa7ac1d71abfd55ba68044ccc43d67d14 /docs/markdown/snippets
parent894623ad5aabaac06fab219173183c4533af74ef (diff)
parent4d2a17041f0dd54001a7d32b36e75608330f41f5 (diff)
downloadmeson-3040f3c8dc620152afea73066f0048c3bbeb7266.zip
meson-3040f3c8dc620152afea73066f0048c3bbeb7266.tar.gz
meson-3040f3c8dc620152afea73066f0048c3bbeb7266.tar.bz2
Merge pull request #6597 from dcbaker/full-project-config
Set project and meson options in cross/native files
Diffstat (limited to 'docs/markdown/snippets')
-rw-r--r--docs/markdown/snippets/project_options_in_machine_files.md52
1 files changed, 52 insertions, 0 deletions
diff --git a/docs/markdown/snippets/project_options_in_machine_files.md b/docs/markdown/snippets/project_options_in_machine_files.md
new file mode 100644
index 0000000..8dab951
--- /dev/null
+++ b/docs/markdown/snippets/project_options_in_machine_files.md
@@ -0,0 +1,52 @@
+## Project and built-in options can be set in native or cross files
+
+A new set of sections has been added to the cross and native files, `[project
+options]` and `[<subproject_name>:project options]`, where `subproject_name`
+is the name of a subproject. Any options that are allowed in the project can
+be set from this section. They have the lowest precedent, and will be
+overwritten by command line arguments.
+
+
+```meson
+option('foo', type : 'string', value : 'foo')
+```
+
+```ini
+[project options]
+foo = 'other val'
+```
+
+```console
+meson build --native-file my.ini
+```
+
+Will result in the option foo having the value `other val`,
+
+```console
+meson build --native-file my.ini -Dfoo='different val'
+```
+
+Will result in the option foo having the value `different val`,
+
+
+Subproject options are assigned like this:
+
+```ini
+[zlib:project options]
+foo = 'some val'
+```
+
+Additionally meson level options can be set in the same way, using the
+`[built-in options]` section.
+
+```ini
+[built-in options]
+c_std = 'c99'
+```
+
+These options can also be set on a per-subproject basis, although only
+`default_library` and `werror` can currently be set:
+```ini
+[zlib:built-in options]
+default_library = 'static'
+```