aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/markdown/Builtin-options.md1
-rw-r--r--docs/markdown/Porting-from-autotools.md4
-rw-r--r--docs/markdown/Reference-manual.md44
-rw-r--r--docs/markdown/Reference-tables.md2
-rw-r--r--docs/markdown/snippets/buildtype_toggles.md21
-rw-r--r--docs/markdown/snippets/dependency_version.md14
-rw-r--r--docs/markdown/snippets/distscript.md12
-rw-r--r--docs/markdown/snippets/native_args.md34
8 files changed, 119 insertions, 13 deletions
diff --git a/docs/markdown/Builtin-options.md b/docs/markdown/Builtin-options.md
index b23cc94..05578c7 100644
--- a/docs/markdown/Builtin-options.md
+++ b/docs/markdown/Builtin-options.md
@@ -74,6 +74,7 @@ platforms or with all compilers:
| b_bitcode | false | true, false | Embed Apple bitcode, see below |
| b_colorout | always | auto, always, never | Use colored output |
| b_coverage | false | true, false | Enable coverage tracking |
+| b_vscrt | from_buildtype| none, md, mdd, mt, mtd, from_buildtype | VS runtime library to use (since 0.48.0) |
| b_lundef | true | true, false | Don't allow undefined symbols when linking |
| b_lto | false | true, false | Use link time optimization |
| b_ndebug | false | true, false, if-release | Disable asserts |
diff --git a/docs/markdown/Porting-from-autotools.md b/docs/markdown/Porting-from-autotools.md
index 5786e0e..5c4c35d 100644
--- a/docs/markdown/Porting-from-autotools.md
+++ b/docs/markdown/Porting-from-autotools.md
@@ -622,8 +622,8 @@ import subprocess
schemadir = os.path.join(os.environ['MESON_INSTALL_PREFIX'], 'share', 'glib-2.0', 'schemas')
if not os.environ.get('DESTDIR'):
- print('Compiling gsettings schemas...')
- subprocess.call(['glib-compile-schemas', schemadir])
+ print('Compiling gsettings schemas...')
+ subprocess.call(['glib-compile-schemas', schemadir])
```
### gettext
diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md
index 3ae740d..e830557 100644
--- a/docs/markdown/Reference-manual.md
+++ b/docs/markdown/Reference-manual.md
@@ -13,13 +13,22 @@ afterwards](#returned-objects).
void add_global_arguments(arg1, arg2, ...)
```
-Adds the positional arguments to the compiler command line for the
-language specified in `language` keyword argument. If a list of
-languages is given, the arguments are added to each of the
-corresponding compiler command lines. Note that there is no way to
-remove an argument set in this way. If you have an argument that is
-only used in a subset of targets, you have to specify it in per-target
-flags.
+Adds the positional arguments to the compiler command line. This
+function has two keyword arguments:
+
+- `language` specifies the language(s) that the arguments should be
+applied to. If a list of languages is given, the arguments are added
+to each of the corresponding compiler command lines. Note that there
+is no way to remove an argument set in this way. If you have an
+argument that is only used in a subset of targets, you have to specify
+it in per-target flags.
+
+- `native` is a boolean specifying whether the arguments should be
+ applied to the native or cross compilation. If `true` the arguments
+ will only be used for native compilations. If `false` the arguments
+ will only be used in cross compilations. If omitted, the flags are
+ added to native compilations if compiling natively and cross
+ compilations (only) when cross compiling. Available since 0.48.0
The arguments are used in all compiler invocations with the exception
of compile tests, because you might need to run a compile test with
@@ -60,8 +69,9 @@ endif
Takes one keyword argument, `required`. It defaults to `true`, which
means that if any of the languages specified is not found, Meson will
halt. Returns true if all languages specified were found and false
-otherwise. Since *0.47.0* the value of a [`feature`](Build-options.md#features)
-option can also be passed to the `required` keyword argument.
+otherwise. Since *0.47.0* the value of a
+[`feature`](Build-options.md#features) option can also be passed to
+the `required` keyword argument.
### add_project_arguments()
@@ -370,11 +380,12 @@ otherwise. This function supports the following keyword arguments:
- `static` tells the dependency provider to try to get static
libraries instead of dynamic ones (note that this is not supported
by all dependency backends)
-- `version`, specifies the required version, a string containing a
+- `version` specifies the required version, a string containing a
comparison operator followed by the version string, examples include
`>1.0.0`, `<=2.3.5` or `3.1.4` for exact matching. (*Added 0.37.0*)
You can also specify multiple restrictions by passing a list to this
keyword argument, such as: `['>=3.14.0', '<=4.1.0']`.
+ These requirements are never met if the version is unknown.
- other
[library-specific](Dependencies.md#dependencies-with-custom-lookup-functionality)
keywords may also be accepted (e.g. `modules` specifies submodules to use for
@@ -1405,6 +1416,15 @@ The `meson` object allows you to introspect various properties of the
system. This object is always mapped in the `meson` variable. It has
the following methods.
+- `add_dist_script` causes the script given as argument to run during
+ `dist` operation after the distribution source has been generated
+ but before it is archived. Note that this runs the script file that
+ is in the _staging_ directory, not the one in the source
+ directory. If the script file can not be found in the staging
+ directory, it is a hard error. This command can only invoked from
+ the main project, calling it from a subproject is a hard
+ error. Available since 0.48.0.
+
- `add_install_script(script_name, arg1, arg2, ...)` causes the script
given as an argument to be run during the install step, this script
will have the environment variables `MESON_SOURCE_ROOT`,
@@ -1976,7 +1996,9 @@ an external dependency with the following methods:
with `declare_dependency()` and `pkgconfig` for system dependencies
obtained with Pkg-config.
- - `version()` is the version number as a string, for example `1.2.8`
+ - `version()` is the version number as a string, for example `1.2.8`.
+ `unknown` if the dependency provider doesn't support determining the
+ version.
- `partial_dependency(compile_args : false, link_args : false, links
: false, includes : false, source : false)` (*added 0.46.0*) returns
diff --git a/docs/markdown/Reference-tables.md b/docs/markdown/Reference-tables.md
index 9aa8609..46bcc3d 100644
--- a/docs/markdown/Reference-tables.md
+++ b/docs/markdown/Reference-tables.md
@@ -33,6 +33,8 @@ These are return values of the `get_id` method in a compiler object.
| MESON_BUILD_ROOT | Absolute path to the build dir |
| MESONINTROSPECT | Command to run to run the introspection command, may be of the form `python /path/to/meson introspect`, user is responsible for splitting the path if necessary. |
| MESON_SUBDIR | Current subdirectory, only set for `run_command` |
+| MESON_DIST_ROOT | Points to the root of the staging directory, only set when running `dist` scripts |
+
## CPU families
diff --git a/docs/markdown/snippets/buildtype_toggles.md b/docs/markdown/snippets/buildtype_toggles.md
new file mode 100644
index 0000000..e6ae53d
--- /dev/null
+++ b/docs/markdown/snippets/buildtype_toggles.md
@@ -0,0 +1,21 @@
+## Toggles for build type, optimization and vcrt type
+
+Since the very beginning Meson has provided different project types to
+use, such as *debug* and *minsize*. There is also a *plain* type that
+adds nothing by default but instead makes it the user's responsibility
+to add everything by hand. This works but is a bit tedious.
+
+In this release we have added new new options to manually toggle
+e.g. optimization levels and debug info so those can be changed
+independently of other options. For example by default the debug
+buildtype has no optmization enabled at all. If you wish to use GCC's
+`-Og` instead, you could set it with the following command:
+
+```
+meson configure -Doptimization=g
+```
+
+Similarly we have added a toggle option to select the version of
+Visual Studio C runtime to use. By default it uses the debug runtime
+DLL debug builds and release DLL for release builds but this can be
+manually changed with the new base option `b_vscrt`.
diff --git a/docs/markdown/snippets/dependency_version.md b/docs/markdown/snippets/dependency_version.md
new file mode 100644
index 0000000..4bbf346
--- /dev/null
+++ b/docs/markdown/snippets/dependency_version.md
@@ -0,0 +1,14 @@
+## `dependency(version:)` now applies to all dependency types
+
+Previously, version constraints were only enforced for dependencies found using
+the pkg-config dependency provider. These constraints now apply to dependencies
+found using any dependency provider.
+
+Some combinations of dependency, host and method do not currently support
+discovery of the version. In these cases, the dependency will not be found if a
+version constraint is applied, otherwise the `version()` method for the
+dependency object will return `'unknown'`.
+
+(If discovering the version in one of these combinations is important to you,
+and a method exists to determine the version in that case, please file an issue
+with as much information as possible.)
diff --git a/docs/markdown/snippets/distscript.md b/docs/markdown/snippets/distscript.md
new file mode 100644
index 0000000..37d05fe
--- /dev/null
+++ b/docs/markdown/snippets/distscript.md
@@ -0,0 +1,12 @@
+## Dist scripts
+
+You can now specify scripts that are run as part of the `dist`
+target. An example usage would go like this:
+
+```meson
+project('foo', 'c')
+
+# other stuff here
+
+meson.add_dist_script('dist_cleanup.py')
+```
diff --git a/docs/markdown/snippets/native_args.md b/docs/markdown/snippets/native_args.md
new file mode 100644
index 0000000..54c6de2
--- /dev/null
+++ b/docs/markdown/snippets/native_args.md
@@ -0,0 +1,34 @@
+## Projects args can be set separately for cross and native builds (potentially breaking change)
+
+It has been a longstanding bug (or let's call it a "delayed bug fix")
+that if yo do this:
+
+```meson
+add_project_arguments('-DFOO', language : 'c')
+```
+
+Then the flag is used both in native and cross compilations. This is
+very confusing and almost never what you want. To fix this a new
+keyword `native` has been added to all functions that add arguments,
+namely `add_global_arguments`, `add_global_link_arguments`,
+`add_project_arguments` and `add_project_link_arguments` that behaves
+like the following:
+
+```
+## Added to native builds when compiling natively and to cross
+## compilations when doing cross compiles.
+add_project_arguments(...)
+
+## Added only to native compilations, not used in cross compilations.
+add_project_arguments(..., native : true)
+
+## Added only to cross compilations, not used in native compilations.
+add_project_arguments(..., native : false)
+```
+
+Also remember that cross compilation is a property of each
+target. There can be target that are compiled with the native compiler
+and some which are compiled with the cross compiler.
+
+Unfortunately this change is backwards incompatible and may cause some
+projects to fail building. However this should be very rare in practice.