aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorTheQwertiest <qwertiest@mail.ru>2020-05-21 17:05:04 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2020-06-29 19:54:38 +0300
commit5696a5abbaaff75279d9c50d431de47f35dc6228 (patch)
treee5b4dadb1d7bf676ebd46b8bde9c13190bb02269 /docs
parent4d0233540f15c686c199d8f464fc7499a094645e (diff)
downloadmeson-5696a5abbaaff75279d9c50d431de47f35dc6228.zip
meson-5696a5abbaaff75279d9c50d431de47f35dc6228.tar.gz
meson-5696a5abbaaff75279d9c50d431de47f35dc6228.tar.bz2
Added ability to specify target in `meson compile`
Diffstat (limited to 'docs')
-rw-r--r--docs/markdown/Commands.md39
-rw-r--r--docs/markdown/snippets/add_meson_compile_target.md19
2 files changed, 53 insertions, 5 deletions
diff --git a/docs/markdown/Commands.md b/docs/markdown/Commands.md
index 4d3de55..e2a352a 100644
--- a/docs/markdown/Commands.md
+++ b/docs/markdown/Commands.md
@@ -136,24 +136,30 @@ meson configure builddir -Doption=new_value
*(since 0.54.0)*
```
-$ meson compile [-h] [-j JOBS] [-l LOAD_AVERAGE] [--clean] [-C BUILDDIR]
+$ meson compile [-h] [--clean] [-C BUILDDIR] [-j JOBS] [-l LOAD_AVERAGE]
[--verbose] [--ninja-args NINJA_ARGS] [--vs-args VS_ARGS]
+ [TARGET [TARGET ...]]
```
Builds a default or a specified target of a configured meson project.
```
+positional arguments:
+ TARGET Targets to build. Target has the
+ following format: [PATH_TO_TARGET/]TARGE
+ T_NAME[:TARGET_TYPE].
+
optional arguments:
-h, --help show this help message and exit
+ --clean Clean the build directory.
+ -C BUILDDIR The directory containing build files to
+ be built.
-j JOBS, --jobs JOBS The number of worker jobs to run (if
supported). If the value is less than 1
the build program will guess.
-l LOAD_AVERAGE, --load-average LOAD_AVERAGE
The system load average to try to
- maintain (if supported)
- --clean Clean the build directory.
- -C BUILDDIR The directory containing build files to
- be built.
+ maintain (if supported).
--verbose Show more verbose output.
--ninja-args NINJA_ARGS Arguments to pass to `ninja` (applied
only on `ninja` backend).
@@ -161,6 +167,19 @@ optional arguments:
only on `vs` backend).
```
+`--verbose` argument is available since 0.55.0.
+
+#### Targets
+
+*(since 0.55.0)*
+
+`TARGET` has the following syntax `[PATH/]NAME[:TYPE]`, where:
+- `NAME`: name of the target from `meson.build` (e.g. `foo` from `executable('foo', ...)`).
+- `PATH`: path to the target relative to the root `meson.build` file. Note: relative path for a target specified in the root `meson.build` is `./`.
+- `TYPE`: type of the target. Can be one of the following: 'executable', 'static_library', 'shared_library', 'shared_module', 'custom', 'run', 'jar'.
+
+`PATH` and/or `TYPE` can be ommited if the resulting `TARGET` can be used to uniquely identify the target in `meson.build`.
+
#### Backend specific arguments
*(since 0.55.0)*
@@ -193,6 +212,16 @@ Execute a dry run on ninja backend with additional debug info:
meson compile --ninja-args=-n,-d,explain
```
+Build three targets: two targets that have the same `foo` name, but different type, and a `bar` target:
+```
+meson compile foo:shared_library foo:static_library bar
+```
+
+Produce a coverage html report (if available):
+```
+meson compile coverage-html
+```
+
### dist
*(since 0.52.0)*
diff --git a/docs/markdown/snippets/add_meson_compile_target.md b/docs/markdown/snippets/add_meson_compile_target.md
new file mode 100644
index 0000000..d75862f
--- /dev/null
+++ b/docs/markdown/snippets/add_meson_compile_target.md
@@ -0,0 +1,19 @@
+## Added ability to specify targets in `meson compile`
+
+It's now possible to specify targets in `meson compile`, which will result in building only the requested targets.
+
+Usage: `meson compile [TARGET [TARGET...]]`
+`TARGET` has the following syntax: `[PATH/]NAME[:TYPE]`.
+`NAME`: name of the target from `meson.build` (e.g. `foo` from `executable('foo', ...)`).
+`PATH`: path to the target relative to the root `meson.build` file. Note: relative path for a target specified in the root `meson.build` is `./`.
+`TYPE`: type of the target (e.g. `shared_library`, `executable` and etc)
+
+`PATH` and/or `TYPE` can be ommited if the resulting `TARGET` can be used to uniquely identify the target in `meson.build`.
+
+For example targets from the following code:
+```meson
+shared_library('foo', ...)
+static_library('foo', ...)
+executable('bar', ...)
+```
+can be invoked with `meson compile foo:shared_library foo:static_library bar`.