From 5c7f9797c3e883ab771f4ee776eacf2a6395f5f6 Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Fri, 19 May 2017 14:50:38 +0100 Subject: docs: Move "build target object" from "build-in objects" to "returned objects" Also move "run result" object so objects are sorted alphabetically --- docs/markdown/Reference-manual.md | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md index 62c0fb3..fd0eadd 100644 --- a/docs/markdown/Reference-manual.md +++ b/docs/markdown/Reference-manual.md @@ -737,18 +737,6 @@ When all compilation is 'native', all the methods return the same values as `bui Note that while cross-compiling, it simply returns the values defined in the cross-info file. If `target_machine` values are not defined in the cross-info file, `host_machine` values are returned instead. -### `build target` object - -A build target is either an [executable](#executable), [shared](#shared_library) or [static library](#static_library). - -- `extract_objects()` returns an opaque value representing the generated object files of arguments, usually used to take single object files and link them to unit tests or to compile some source files with custom flags. To use the object file(s) in another build target, use the `objects:` keyword argument. - -- `extract_all_objects()` is same as above but returns all object files generated by this target - -- `private_dir_include()` returns a opaque value that works like `include_directories` but points to the private directory of this target, usually only needed if an another target needs to access some generated internal headers of this target - -- `full_path()` returns a full path pointing to the result target file - ### `compiler` object This object is returned by [`meson.get_compiler(lang)`](#meson-object). It represents a compiler for a given language and allows you to query its properties. It has the following methods: @@ -833,14 +821,17 @@ You can also iterate over arrays with the [`foreach` statement](https://github.c These are objects returned by the [functions listed above](#functions). -### `run result` object +### `build target` object -This object encapsulates the result of trying to compile and run a sample piece of code with [`compiler.run()`](#compiler-object) or [`run_command()`](#run_command). It has the following methods: +A build target is either an [executable](#executable), [shared](#shared_library) or [static library](#static_library). -- `compiled()` if true, the compilation succeeded, if false it did not and the other methods return unspecified data -- `returncode()` the return code of executing the compiled binary -- `stdout()` the standard out produced when the binary was run -- `stderr()` the standard error produced when the binary was run +- `extract_objects()` returns an opaque value representing the generated object files of arguments, usually used to take single object files and link them to unit tests or to compile some source files with custom flags. To use the object file(s) in another build target, use the `objects:` keyword argument. + +- `extract_all_objects()` is same as above but returns all object files generated by this target + +- `private_dir_include()` returns a opaque value that works like `include_directories` but points to the private directory of this target, usually only needed if an another target needs to access some generated internal headers of this target + +- `full_path()` returns a full path pointing to the result target file ### `configuration` data object @@ -906,3 +897,11 @@ This object is returned by [`subproject()`](#subproject) and is an opaque object subproject. This is useful to, for instance, get a [declared dependency](#declare_dependency) from the subproject. +### `run result` object + +This object encapsulates the result of trying to compile and run a sample piece of code with [`compiler.run()`](#compiler-object) or [`run_command()`](#run_command). It has the following methods: + +- `compiled()` if true, the compilation succeeded, if false it did not and the other methods return unspecified data +- `returncode()` the return code of executing the compiled binary +- `stdout()` the standard out produced when the binary was run +- `stderr()` the standard error produced when the binary was run -- cgit v1.1 From f12a7f2ad0e3c58ce4c974a9f3294ce756bccbac Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Fri, 19 May 2017 14:53:14 +0100 Subject: docs: Correct list of things that are a build target to include shared_module --- docs/markdown/Reference-manual.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md index fd0eadd..9f71d31 100644 --- a/docs/markdown/Reference-manual.md +++ b/docs/markdown/Reference-manual.md @@ -823,7 +823,7 @@ These are objects returned by the [functions listed above](#functions). ### `build target` object -A build target is either an [executable](#executable), [shared](#shared_library) or [static library](#static_library). +A build target is either an [executable](#executable), [shared](#shared_library), [static library](#static_library) or [shared module](#shared_module). - `extract_objects()` returns an opaque value representing the generated object files of arguments, usually used to take single object files and link them to unit tests or to compile some source files with custom flags. To use the object file(s) in another build target, use the `objects:` keyword argument. -- cgit v1.1 From cad83867330e38b0c6d896b71457a95a62744670 Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Fri, 19 May 2017 14:59:26 +0100 Subject: docs: Document the object returned by custom_target --- docs/markdown/Reference-manual.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md index 9f71d31..04ba15f 100644 --- a/docs/markdown/Reference-manual.md +++ b/docs/markdown/Reference-manual.md @@ -132,7 +132,7 @@ These are all the supported keyword arguments: ### custom_target() ``` meson - ctarget custom_target(*name*, ...) + customtarget custom_target(*name*, ...) ``` Create a custom top level build target. The only positional argument is the name of this target and the keyword arguments are the following. @@ -158,6 +158,8 @@ The list of strings passed to the `command` keyword argument accept the followin - `@OUTDIR@` the full path to the directory where the output(s) must be written - `@DEPFILE@` the full path to the dependency file passed to `depfile` +The returned object also has methods that are documented in the [object methods section](#custom-target-object) below. + ### declare_dependency() ``` meson @@ -647,7 +649,7 @@ Defined tests can be run in a backend-agnostic way by calling `mesontest` inside ### vcs_tag() ``` meson - ctarget vcs_tag(...) + customtarget vcs_tag(...) ``` This command detects revision control commit information at build time and places it in the specified output file. This file is guaranteed to be up to date on every build. Keywords are similar to `custom_target`. @@ -845,6 +847,12 @@ This object is returned by [`configuration_data()`](#configuration_data) and enc They all take the `description` keyword that will be written in the result file. The replacement assumes a file with C syntax. If your generated file is source code in some other language, you probably don't want to add a description field because it most likely will cause a syntax error. +### `custom target` object + +This object is returned by [`custom_target`](#custom_target) and contains a target with the following methods: + +- `full_path()` returns a full path pointing to the result target file + ### `dependency` object This object is returned by [`dependency()`](#dependency) and contains an external dependency with the following methods: -- cgit v1.1 From 75099510f1c7d1a52b589b4364fe6bb64d7aeb4e Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Fri, 19 May 2017 15:03:43 +0100 Subject: docs: The return value of executable() is a builttarget object. Make executable() consistent with all other functions returning a buildtarget, it's return type is a buildtarget object. --- docs/markdown/Reference-manual.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md index 04ba15f..366ece7 100644 --- a/docs/markdown/Reference-manual.md +++ b/docs/markdown/Reference-manual.md @@ -214,7 +214,7 @@ Returns an empty [environment variable object](#environment-object). ### executable() ``` meson - exe executable(*exe_name*, *sources*, ...) + buildtarget executable(*exe_name*, *sources*, ...) ``` Creates a new executable. The first argument specifies its name and the remaining positional arguments define the input files to use. They can be of the following types: -- cgit v1.1