aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown/snippets
diff options
context:
space:
mode:
Diffstat (limited to 'docs/markdown/snippets')
-rw-r--r--docs/markdown/snippets/customtarget_env.md2
-rw-r--r--docs/markdown/snippets/fs_read.md40
-rw-r--r--docs/markdown/snippets/gnome_install_script.md9
-rw-r--r--docs/markdown/snippets/install_dry_run.md4
-rw-r--r--docs/markdown/snippets/lto_mode.md5
-rw-r--r--docs/markdown/snippets/lto_threads.md7
-rw-r--r--docs/markdown/snippets/meson_test_depends.md2
-rw-r--r--docs/markdown/snippets/unstable-rust-module.md2
-rw-r--r--docs/markdown/snippets/vala_unity_builds_disabled.md7
9 files changed, 75 insertions, 3 deletions
diff --git a/docs/markdown/snippets/customtarget_env.md b/docs/markdown/snippets/customtarget_env.md
index 69bfc0d..f2d651b 100644
--- a/docs/markdown/snippets/customtarget_env.md
+++ b/docs/markdown/snippets/customtarget_env.md
@@ -1,4 +1,4 @@
-## `custom_target()` now accepts an `env` keyword argument
+## `custom_target()` and `run_target()` now accepts an `env` keyword argument
Environment variables can now be passed to the `custom_target()` command.
diff --git a/docs/markdown/snippets/fs_read.md b/docs/markdown/snippets/fs_read.md
new file mode 100644
index 0000000..05c215a
--- /dev/null
+++ b/docs/markdown/snippets/fs_read.md
@@ -0,0 +1,40 @@
+## Support for reading files at configuration time with the `fs` module
+
+Reading text files during configuration is now supported. This can be done at
+any time after `project` has been called
+
+```meson
+project(myproject', 'c')
+license_text = run_command(
+ find_program('python3'), '-c', 'print(open("COPYING").read())'
+).stdout().strip()
+about_header = configuration_data()
+about_header.add('COPYRIGHT', license_text)
+about_header.add('ABOUT_STRING', meson.project_name())
+...
+```
+
+There are several problems with the above approach:
+1. It's ugly and confusing
+2. If `COPYING` changes after configuration, Meson won't correctly rebuild when
+ configuration data is based on the data in COPYING
+3. It has extra overhead
+
+`fs.read` replaces the above idiom thus:
+```meson
+project(myproject', 'c')
+fs = import('fs')
+license_text = fs.read('COPYING').strip()
+about_header = configuration_data()
+about_header.add('COPYRIGHT', license_text)
+about_header.add('ABOUT_STRING', meson.project_name())
+...
+```
+
+They are not equivalent, though. Files read with `fs.read` create a
+configuration dependency on the file, and so if the `COPYING` file is modified,
+Meson will automatically reconfigure, guaranteeing the build is consistent. It
+can be used for any properly encoded text files. It supports specification of
+non utf-8 encodings too, so if you're stuck with text files in a different
+encoding, it can be passed as an argument. See the [`meson`
+object](Reference-manual.md#meson-object) documentation for details.
diff --git a/docs/markdown/snippets/gnome_install_script.md b/docs/markdown/snippets/gnome_install_script.md
new file mode 100644
index 0000000..03fcfe4
--- /dev/null
+++ b/docs/markdown/snippets/gnome_install_script.md
@@ -0,0 +1,9 @@
+## `gnome.post_install()`
+
+Post-install update of various system wide caches. Each script will be executed
+only once even if `gnome.post_install()` is called multiple times from multiple
+subprojects. If `DESTDIR` is specified during installation all scripts will be
+skipped.
+
+Currently supports `glib-compile-schemas`, `gio-querymodules`, and
+`gtk-update-icon-cache`.
diff --git a/docs/markdown/snippets/install_dry_run.md b/docs/markdown/snippets/install_dry_run.md
new file mode 100644
index 0000000..8106a06
--- /dev/null
+++ b/docs/markdown/snippets/install_dry_run.md
@@ -0,0 +1,4 @@
+## meson install --dry-run
+
+New option to meson install command that does not actually install files, but
+only print messages.
diff --git a/docs/markdown/snippets/lto_mode.md b/docs/markdown/snippets/lto_mode.md
new file mode 100644
index 0000000..c1df066
--- /dev/null
+++ b/docs/markdown/snippets/lto_mode.md
@@ -0,0 +1,5 @@
+## Support added for LLVM's thinLTO
+
+A new `b_lto_mode` option has been added, which may be set to `default` or
+`thin`. Thin only works for clang, and only with gnu gold, lld variants, or
+ld64.
diff --git a/docs/markdown/snippets/lto_threads.md b/docs/markdown/snippets/lto_threads.md
new file mode 100644
index 0000000..77c8047
--- /dev/null
+++ b/docs/markdown/snippets/lto_threads.md
@@ -0,0 +1,7 @@
+## Knob to control LTO thread
+
+Both the gnu linker and lld support using threads for speeding up LTO, meson
+now provides a knob for this: `-Db_lto_threads`. Currently this is only
+supported for clang and gcc. Any positive integer is supported, `0` means
+`auto`. If the compiler or linker implements it's on `auto` we use that,
+otherwise the number of threads on the machine is used.
diff --git a/docs/markdown/snippets/meson_test_depends.md b/docs/markdown/snippets/meson_test_depends.md
index 905c59f..46ec328 100644
--- a/docs/markdown/snippets/meson_test_depends.md
+++ b/docs/markdown/snippets/meson_test_depends.md
@@ -12,5 +12,5 @@ using commands like the following:
This would find the broken commit automatically while at each step
rebuilding only those pieces of code needed to run the test.
-However, this change could cause failures when upgrading to 0.57, ifthe
+However, this change could cause failures when upgrading to 0.57, if the
dependencies are not specified correctly in `meson.build`.
diff --git a/docs/markdown/snippets/unstable-rust-module.md b/docs/markdown/snippets/unstable-rust-module.md
index 47790e3..e594ecf 100644
--- a/docs/markdown/snippets/unstable-rust-module.md
+++ b/docs/markdown/snippets/unstable-rust-module.md
@@ -1,4 +1,4 @@
-## Untable Rust module
+## Unstable Rust module
A new unstable module has been added to make using Rust with Meson easier.
Currently it adds a single function to ease defining Rust tests.
diff --git a/docs/markdown/snippets/vala_unity_builds_disabled.md b/docs/markdown/snippets/vala_unity_builds_disabled.md
new file mode 100644
index 0000000..80e6523
--- /dev/null
+++ b/docs/markdown/snippets/vala_unity_builds_disabled.md
@@ -0,0 +1,7 @@
+## Unity build with Vala disabled
+
+The approach that meson has used for Vala unity builds is incorrect, we
+combine the generated C files like we would any other C file. This is very
+fragile however, as the Vala compiler generates helper functions and macros
+which work fine when each file is a separate translation unit, but fail when
+they are combined.