diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/markdown/Build-options.md | 13 | ||||
-rw-r--r-- | docs/markdown/Generating-sources.md | 2 | ||||
-rw-r--r-- | docs/markdown/Reference-manual.md | 18 | ||||
-rw-r--r-- | docs/markdown/Release-notes-for-0.43.0/001-generator-capture.md | 4 | ||||
-rw-r--r-- | docs/markdown/Unit-tests.md | 18 | ||||
-rw-r--r-- | docs/markdown/i18n-module.md | 2 | ||||
-rw-r--r-- | docs/markdown/snippets/custom-target-index.md | 21 |
7 files changed, 61 insertions, 17 deletions
diff --git a/docs/markdown/Build-options.md b/docs/markdown/Build-options.md index 54905d5..cb7b19e 100644 --- a/docs/markdown/Build-options.md +++ b/docs/markdown/Build-options.md @@ -42,11 +42,16 @@ prefix = get_option('prefix') ``` It should be noted that you can not set option values in your Meson -scripts. They have to be set externally with the `mesonconf` command -line tool. Running `mesonconf` without arguments in a build dir shows -you all options you can set. To change their values use the `-D` +scripts. They have to be set externally with the `meson configure` command +line tool. Running `meson configure` without arguments in a build dir shows +you all options you can set. + +To change their values use the `-D` option: ```console -$ mesonconf -Doption=newvalue +$ meson configure -Doption=newvalue ``` + + +**NOTE:** If you cannot call `meson configure` you likely have a old version of Meson. In that case you can call `mesonconf` instead, but that is deprecated in newer versions diff --git a/docs/markdown/Generating-sources.md b/docs/markdown/Generating-sources.md index c251805..c5e338d 100644 --- a/docs/markdown/Generating-sources.md +++ b/docs/markdown/Generating-sources.md @@ -31,7 +31,7 @@ gen_src = custom_target('gen-output', '--h-out', '@OUTPUT1@']) ``` -The `@INPUT@` there will be transformed to `'out.c' 'out.h'`. Just like the output, you can also refer to each input file individually by index. +The `@INPUT@` there will be transformed to `'somefile1.c' 'file2.c'`. Just like the output, you can also refer to each input file individually by index. Then you just put that in your program and you're done. diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md index de51479..f37fb34 100644 --- a/docs/markdown/Reference-manual.md +++ b/docs/markdown/Reference-manual.md @@ -554,6 +554,9 @@ following: - `output` a template string (or list of template strings) defining how an output file name is (or multiple output names are) generated from a single source file name +- `capture` when this argument is set to true, Meson captures `stdout` + of the `executable` and writes it to the target file specified as + `output`. Available since v0.43.0. The returned object also has methods that are documented in the [object methods section](#generator-object) below. @@ -1309,9 +1312,9 @@ the following methods: - `get_id()` returns a string identifying the compiler. For example, `gcc`, `msvc`, [and more](Compiler-properties.md#compiler-id). -- `get_supported_arguments(list_of_string)` returns an array - containing only the arguments supported by the compiler, as if - `has_argument` were called on them individually. +- `get_supported_arguments(list_of_string)` *(added 0.43.0)* returns + an array containing only the arguments supported by the compiler, + as if `has_argument` were called on them individually. - `has_argument(argument_name)` returns true if the compiler accepts the specified command line argument, that is, can compile code @@ -1440,7 +1443,9 @@ are immutable, all operations return their results as a new string. - `startswith(string)` returns true if string starts with the string specified as the argument -- `strip()` removes whitespace at the beginning and end of the string +- `strip()` removes whitespace at the beginning and end of the string + *(added 0.43.0)* optionally can take one positional string argument, + and all characters in that string will be stripped - `to_int` returns the string converted to an integer (error if string is not a number) @@ -1565,6 +1570,11 @@ contains a target with the following methods: this and will also allow Meson to setup inter-target dependencies correctly. Please file a bug if that doesn't work for you. +- `[index]` returns an opaque object that references this target, and can be + used as a source in other targets. When it is used as such it will make that + target depend on this custom target, but the only source added will be the + one that corresponds to the index of the custom target's output argument. + ### `dependency` object This object is returned by [`dependency()`](#dependency) and contains diff --git a/docs/markdown/Release-notes-for-0.43.0/001-generator-capture.md b/docs/markdown/Release-notes-for-0.43.0/001-generator-capture.md new file mode 100644 index 0000000..4eb7fc0 --- /dev/null +++ b/docs/markdown/Release-notes-for-0.43.0/001-generator-capture.md @@ -0,0 +1,4 @@ +## Generator learned capture + +Generators can now be configured to capture the standard output. See +`test cases/common/98 gen extra/meson.build` for an example. diff --git a/docs/markdown/Unit-tests.md b/docs/markdown/Unit-tests.md index 7949522..6ded714 100644 --- a/docs/markdown/Unit-tests.md +++ b/docs/markdown/Unit-tests.md @@ -57,42 +57,42 @@ Sometimes a test can only determine at runtime that it can not be run. The GNU s ## Testing tool -In version 0.37.0 a new tool called `mesontest` was added. The goal of this tool is to provide a simple way to run tests in a variety of different ways. The tool is designed to be run in the build directory. +The goal of the meson test tool is to provide a simple way to run tests in a variety of different ways. The tool is designed to be run in the build directory. The simplest thing to do is just to run all tests, which is equivalent to running `ninja test`. ```console -$ mesontest +$ meson test ``` You can also run only a single test by giving its name: ```console -$ mesontest testname +$ meson test testname ``` Sometimes you need to run the tests multiple times, which is done like this: ```console -$ mesontest --repeat=10 +$ meson test --repeat=10 ``` Invoking tests via a helper executable such as Valgrind can be done with the `--wrap` argument ```console -$ mesontest --wrap=valgrind testname +$ meson test --wrap=valgrind testname ``` Arguments to the wrapper binary can be given like this: ```console -$ mesontest --wrap='valgrind --tool=helgrind' testname +$ meson test --wrap='valgrind --tool=helgrind' testname ``` Meson also supports running the tests under GDB. Just doing this: ```console -$ mesontest --gdb testname +$ meson test --gdb testname ``` Mesontest will launch `gdb` all set up to run the test. Just type `run` in the GDB command prompt to start the program. @@ -100,9 +100,11 @@ Mesontest will launch `gdb` all set up to run the test. Just type `run` in the G The second use case is a test that segfaults only rarely. In this case you can invoke the following command: ```console -$ mesontest --gdb --repeat=10000 testname +$ meson test --gdb --repeat=10000 testname ``` This runs the test up to 10 000 times under GDB automatically. If the program crashes, GDB will halt and the user can debug the application. Note that testing timeouts are disabled in this case so mesontest will not kill `gdb` while the developer is still debugging it. The downside is that if the test binary freezes, the test runner will wait forever. For further information see the command line help of Mesontest by running `mesontest -h`. + +**NOTE:** If `meson test` does not work for you, you likely have a old version of Meson. In that case you should call `mesontest` instead. If `mesontest` doesn't work either you have a very old version prior to 0.37.0 and should upgrade. diff --git a/docs/markdown/i18n-module.md b/docs/markdown/i18n-module.md index 5e6004a..1144e29 100644 --- a/docs/markdown/i18n-module.md +++ b/docs/markdown/i18n-module.md @@ -32,6 +32,8 @@ argument which is the name of the gettext module. [source](https://github.com/mesonbuild/meson/blob/master/mesonbuild/modules/i18n.py) for for their value +* `install`: (*Added 0.43.0*) if false, do not install the built translations. + This function also defines targets for maintainers to use: **Note**: These output to the source directory diff --git a/docs/markdown/snippets/custom-target-index.md b/docs/markdown/snippets/custom-target-index.md new file mode 100644 index 0000000..10d7cf1 --- /dev/null +++ b/docs/markdown/snippets/custom-target-index.md @@ -0,0 +1,21 @@ +# Can index CustomTaget objects + +The `CustomTarget` object can now be indexed like an array. The resulting +object can be used as a source file for other Targets, this will create a +dependency on the original `CustomTarget`, but will only insert the generated +file corresponding to the index value of the `CustomTarget`'s `output` keyword. + + c = CustomTarget( + ... + output : ['out.h', 'out.c'], + ) + lib1 = static_library( + 'lib1', + [lib1_sources, c[0]], + ... + ) + exec = executable( + 'executable', + c[1], + link_with : lib1, + ) |