diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/markdown/Builtin-options.md | 61 | ||||
-rw-r--r-- | docs/markdown/Dependencies.md | 8 | ||||
-rw-r--r-- | docs/markdown/Keyval-module.md | 4 | ||||
-rw-r--r-- | docs/markdown/Reference-manual.md | 3 | ||||
-rw-r--r-- | docs/markdown/Syntax.md | 20 | ||||
-rw-r--r-- | docs/markdown/Vala.md | 2 | ||||
-rw-r--r-- | docs/markdown/snippets/keyval.md | 7 | ||||
-rw-r--r-- | docs/markdown/snippets/per_subproject.md | 4 |
8 files changed, 83 insertions, 26 deletions
diff --git a/docs/markdown/Builtin-options.md b/docs/markdown/Builtin-options.md index e7101d5..6234ecf 100644 --- a/docs/markdown/Builtin-options.md +++ b/docs/markdown/Builtin-options.md @@ -59,27 +59,27 @@ Options that are labeled "per machine" in the table are set per machine. See the [specifying options per machine](#Specifying-options-per-machine) section for details. -| Option | Default value | Description | Is per machine | -| ------ | ------------- | ----------- | -------------- | -| auto_features {enabled, disabled, auto} | auto | Override value of all 'auto' features | no | -| backend {ninja, vs,<br>vs2010, vs2015, vs2017, vs2019, xcode} | ninja | Backend to use | no | -| buildtype {plain, debug,<br>debugoptimized, release, minsize, custom} | debug | Build type to use | no | -| debug | true | Debug | no | -| default_library {shared, static, both} | shared | Default library type | no | -| errorlogs | true | Whether to print the logs from failing tests. | no | -| install_umask {preserve, 0000-0777} | 022 | Default umask to apply on permissions of installed files | no | -| layout {mirror,flat} | mirror | Build directory layout | no | -| optimization {0, g, 1, 2, 3, s} | 0 | Optimization level | no | -| pkg_config_path {OS separated path} | '' | Additional paths for pkg-config to search before builtin paths | yes | -| cmake_prefix_path | [] | Additional prefixes for cmake to search before builtin paths | yes | -| stdsplit | true | Split stdout and stderr in test logs | no | -| strip | false | Strip targets on install | no | -| unity {on, off, subprojects} | off | Unity build | no | -| unity_size {>=2} | 4 | Unity file block size | no | -| warning_level {0, 1, 2, 3} | 1 | Set the warning level. From 0 = none to 3 = highest | no | -| werror | false | Treat warnings as errors | no | -| wrap_mode {default, nofallback,<br>nodownload, forcefallback} | default | Wrap mode to use | no | -| force_fallback_for | [] | Force fallback for those dependencies | no | +| Option | Default value | Description | Is per machine | Is per subproject | +| ------ | ------------- | ----------- | -------------- | ----------------- | +| auto_features {enabled, disabled, auto} | auto | Override value of all 'auto' features | no | no | +| backend {ninja, vs,<br>vs2010, vs2015, vs2017, vs2019, xcode} | ninja | Backend to use | no | no | +| buildtype {plain, debug,<br>debugoptimized, release, minsize, custom} | debug | Build type to use | no | no | +| debug | true | Debug | no | no | +| default_library {shared, static, both} | shared | Default library type | no | yes | +| errorlogs | true | Whether to print the logs from failing tests. | no | no | +| install_umask {preserve, 0000-0777} | 022 | Default umask to apply on permissions of installed files | no | no | +| layout {mirror,flat} | mirror | Build directory layout | no | no | +| optimization {0, g, 1, 2, 3, s} | 0 | Optimization level | no | no | +| pkg_config_path {OS separated path} | '' | Additional paths for pkg-config to search before builtin paths | yes | no | +| cmake_prefix_path | [] | Additional prefixes for cmake to search before builtin paths | yes | no | +| stdsplit | true | Split stdout and stderr in test logs | no | no | +| strip | false | Strip targets on install | no | no | +| unity {on, off, subprojects} | off | Unity build | no | no | +| unity_size {>=2} | 4 | Unity file block size | no | no | +| warning_level {0, 1, 2, 3} | 1 | Set the warning level. From 0 = none to 3 = highest | no | yes | +| werror | false | Treat warnings as errors | no | yes | +| wrap_mode {default, nofallback,<br>nodownload, forcefallback} | default | Wrap mode to use | no | no | +| force_fallback_for | [] | Force fallback for those dependencies | no | no | <a name="build-type-options"></a> For setting optimization levels and toggling debug, you can either set the @@ -215,3 +215,22 @@ the command line, as there was no `build.` prefix. Similarly named fields in the `[properties]` section of the cross file would effect cross compilers, but the code paths were fairly different allowing differences in behavior to crop out. + +## Specifying options per subproject + +Since *0.54.0* `default_library` and `werror` built-in options can be defined +per subproject. This is useful for example when building shared libraries in the +main project, but static link a subproject, or when the main project must build +with no warnings but some subprojects cannot. + +Most of the time this would be used either by the parent project by setting +subproject's default_options (e.g. `subproject('foo', default_options: 'default_library=static')`), +or by the user using the command line `-Dfoo:default_library=static`. + +The value is overriden in this order: +- Value from parent project +- Value from subproject's default_options if set +- Value from subproject() default_options if set +- Value from command line if set + +Since 0.56.0 `warning_level` can also be defined per subproject. diff --git a/docs/markdown/Dependencies.md b/docs/markdown/Dependencies.md index a8f6d8a..b89a0aa 100644 --- a/docs/markdown/Dependencies.md +++ b/docs/markdown/Dependencies.md @@ -288,8 +288,12 @@ You can call `dependency` multiple times with different modules and use those to link against your targets. If your boost headers or libraries are in non-standard locations you -can set the BOOST_ROOT, BOOST_INCLUDEDIR, and/or BOOST_LIBRARYDIR -environment variables. +can set the `BOOST_ROOT`, or the `BOOST_INCLUDEDIR` and `BOOST_LIBRARYDIR` +environment variables. *(added in 0.56.0)* You can also set these +parameters as `boost_root`, `boost_include`, and `boost_librarydir` in your +native or cross machine file. Note that machine file variables are +preferred to environment variables, and that specifying any of these +disables system-wide search for boost. You can set the argument `threading` to `single` to use boost libraries that have been compiled for single-threaded use instead. diff --git a/docs/markdown/Keyval-module.md b/docs/markdown/Keyval-module.md index 643265e..afc48fa 100644 --- a/docs/markdown/Keyval-module.md +++ b/docs/markdown/Keyval-module.md @@ -1,5 +1,5 @@ --- -short-description: Unstable keyval module +short-description: Keyval module authors: - name: Mark Schulte, Paolo Bonzini years: [2017, 2019] @@ -23,7 +23,7 @@ chosen the configuration options), output a ".config" file. The module may be imported as follows: ``` meson -keyval = import('unstable-keyval') +keyval = import('keyval') ``` The following functions will then be available as methods on the object diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md index 966d408..080fe3e 100644 --- a/docs/markdown/Reference-manual.md +++ b/docs/markdown/Reference-manual.md @@ -1977,6 +1977,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 +- `substring(start,end)` *(since 0.56.0)*: returns a substring specified from start to end. + Both `start` and `end` arguments are optional, so, for example, `'foobar'.substring()` will return `'foobar'`. + - `strip()`: removes whitespace at the beginning and end of the string. *(since 0.43.0)* Optionally can take one positional string argument, and all characters in that string will be stripped. diff --git a/docs/markdown/Syntax.md b/docs/markdown/Syntax.md index 7cb39e9..bbe3dbb 100644 --- a/docs/markdown/Syntax.md +++ b/docs/markdown/Syntax.md @@ -220,6 +220,26 @@ is_x86 = target.startswith('x86') # boolean value 'true' is_bsd = target.to_lower().endswith('bsd') # boolean value 'true' ``` +#### .substring() + +Since 0.56.0, you can extract a substring from a string. + +```meson +# Similar to the Python str[start:end] syntax +target = 'x86_FreeBSD' +platform = target.substring(0, 3) # prefix string value 'x86' +system = target.substring(4) # suffix string value 'FreeBSD' +``` + +The method accepts negative values where negative `start` is relative to the end of +string `len(string) - start` as well as negative `end`. + +```meson +string = 'foobar' +target.substring(-5, -3) # => 'oo' +target.substring(1, -1) # => 'ooba' +``` + #### .split(), .join() ```meson diff --git a/docs/markdown/Vala.md b/docs/markdown/Vala.md index cbb58a9..0a29847 100644 --- a/docs/markdown/Vala.md +++ b/docs/markdown/Vala.md @@ -237,7 +237,7 @@ dependencies = [ dependency('glib-2.0'), dependency('gobject-2.0'), meson.get_compiler('c').find_library('foo'), - meson.get_compiler('vala').find_library('foo', dir: vapi_dir), + meson.get_compiler('vala').find_library('foo', dirs: vapi_dir), ] sources = files('app.vala') diff --git a/docs/markdown/snippets/keyval.md b/docs/markdown/snippets/keyval.md new file mode 100644 index 0000000..895de9b --- /dev/null +++ b/docs/markdown/snippets/keyval.md @@ -0,0 +1,7 @@ +## `unstable-keyval` is now stable `keyval` + +The `unstable-keyval` has been renamed to `keyval` and now promises stability +guarantees. + +Meson will print a warning when you load an `unstable-` module that has been +stabilised (so `unstable-keyval` is still accepted for example). diff --git a/docs/markdown/snippets/per_subproject.md b/docs/markdown/snippets/per_subproject.md new file mode 100644 index 0000000..6de6068 --- /dev/null +++ b/docs/markdown/snippets/per_subproject.md @@ -0,0 +1,4 @@ +## Per subproject `warning_level` option + +`warning_level` can now be defined per subproject, in the same way as +`default_library` and `werror`. |