diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2020-10-01 10:14:20 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2020-10-01 12:35:42 -0700 |
commit | 20663564bdde2a0ec4977b011259b09523555bcb (patch) | |
tree | 1240881edf7238a3252f34aece72a224582ff51d | |
parent | 1d04caff29f675329ecb6491b50578474d71b6f4 (diff) | |
download | meson-20663564bdde2a0ec4977b011259b09523555bcb.zip meson-20663564bdde2a0ec4977b011259b09523555bcb.tar.gz meson-20663564bdde2a0ec4977b011259b09523555bcb.tar.bz2 |
deprecated get_configtool_variable and get_pkgconfig_variable
The get_variable method is able to do everything they do and more,
making it generally more useful. Let's tell people to stop using the old
ones.
-rw-r--r-- | docs/markdown/Reference-manual.md | 24 | ||||
-rw-r--r-- | docs/markdown/snippets/deprecate_old_variable_methods.md | 4 | ||||
-rw-r--r-- | mesonbuild/interpreter.py | 4 |
3 files changed, 22 insertions, 10 deletions
diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md index 563cfe4..98b3233 100644 --- a/docs/markdown/Reference-manual.md +++ b/docs/markdown/Reference-manual.md @@ -266,7 +266,7 @@ build directory with the name `output:` in the current directory. These are all the supported keyword arguments: - `capture` *(since 0.41.0)*: when this argument is set to true, - Meson captures `stdout` of the `command` and writes it to the target + Meson captures `stdout` of the `command` and writes it to the target file specified as `output`. - `command`: as explained above, if specified, Meson does not create the file itself but rather runs the specified command, which allows @@ -392,7 +392,7 @@ the following special string substitutions: - `@BASENAME@`: the input filename, with extension removed - `@PRIVATE_DIR@` *(since 0.50.1)*: path to a directory where the custom target must store all its intermediate files. -*(since 0.47.0)* The `depfile` keyword argument also accepts the `@BASENAME@` and `@PLAINNAME@` substitutions. +*(since 0.47.0)* The `depfile` keyword argument also accepts the `@BASENAME@` and `@PLAINNAME@` substitutions. The returned object also has methods that are documented in the [object methods section](#custom-target-object) below. @@ -488,7 +488,7 @@ arguments: by all dependency backends) - `version` *(since 0.37.0)*: 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. + `>1.0.0`, `<=2.3.5` or `3.1.4` for exact matching. 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. @@ -620,8 +620,8 @@ be passed to [shared and static libraries](#library). custom targets. The user must ensure that the output is a library in the correct format. - `link_with`: one or more shared or static libraries (built by this - project) that this target should be linked with. *(since 0.41.0)* If passed a - list this list will be flattened. *(since 0.51.0)* The arguments can also be custom targets. + project) that this target should be linked with. *(since 0.41.0)* If passed a + list this list will be flattened. *(since 0.51.0)* The arguments can also be custom targets. In this case Meson will assume that merely adding the output file in the linker command line is sufficient to make linking work. If this is not sufficient, then the build system writer must write all other steps manually. @@ -728,7 +728,7 @@ Keyword arguments are the following: - `disabler` *(since 0.49.0)*: if `true` and the program couldn't be found, return a [disabler object](#disabler-object) instead of a not-found object. - + - `version` *(since 0.52.0)*: specifies the required version, see [`dependency()`](#dependency) for argument format. The version of the program @@ -2204,7 +2204,7 @@ the following methods: whether a particular symbol (function, variable, #define, type definition, etc) is declared in the specified header, you can specify external dependencies to use with `dependencies` keyword - argument. *(since 0.50.0)* The `required` keyword argument can be + argument. *(since 0.50.0)* The `required` keyword argument can be used to abort if the symbol cannot be found. - `has_member(typename, membername)`: takes two arguments, type name @@ -2273,7 +2273,7 @@ The following keyword arguments can be used: pass a library name `-lfoo` for `has_function` to check for a function. Supported by all methods except `get_id`, `version`, and `find_library`. -- `include_directories` *(since 0.38.0)*: specifies extra directories for +- `include_directories` *(since 0.38.0)*: specifies extra directories for header searches. - `name`: the name to use for printing a message about the compiler @@ -2362,8 +2362,8 @@ page](Configuration.md) It has three methods: - `has(varname)`: returns `true` if the specified variable is set -- `merge_from(other)` *(since 0.42.0)*: takes as argument a different - configuration data object and copies all entries from that object to +- `merge_from(other)` *(since 0.42.0)*: takes as argument a different + configuration data object and copies all entries from that object to the current. - `set(varname, value)`, sets a variable to a given value @@ -2422,10 +2422,14 @@ an external dependency with the following methods: *(since 0.45.0)* A warning is issued if the variable is not defined, unless a `default` parameter is specified. + *(Deprecated since 0.56.0*) use `get_variable(pkgconfig : ...)` instead + - `get_configtool_variable(varname)` *(since 0.44.0)*: gets the command line argument from the config tool (with `--` prepended), or, if invoked on a non config-tool dependency, error out. + *(Deprecated since 0.56.0*) use `get_variable(configtool : ...)` instead + - `type_name()`: returns a string describing the type of the dependency, the most common values are `internal` for deps created with `declare_dependency()` and `pkgconfig` for system dependencies diff --git a/docs/markdown/snippets/deprecate_old_variable_methods.md b/docs/markdown/snippets/deprecate_old_variable_methods.md new file mode 100644 index 0000000..3f41689 --- /dev/null +++ b/docs/markdown/snippets/deprecate_old_variable_methods.md @@ -0,0 +1,4 @@ +## Deprecate Dependency.get_pkgconfig_variable and Dependency.get_configtool_variable + +These have been replaced with the more versatile `get_variable()` method +already, and shouldn't be used anymore. diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index 0e5e0f8..c56eff5 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -459,6 +459,8 @@ class DependencyHolder(InterpreterObject, ObjectHolder): def name_method(self, args, kwargs): return self.held_object.get_name() + @FeatureDeprecated('Dependency.get_pkgconfig_variable', '0.56.0', + 'use Dependency.get_variable(pkgconfig : ...) instead') @permittedKwargs({'define_variable', 'default'}) def pkgconfig_method(self, args, kwargs): args = listify(args) @@ -470,6 +472,8 @@ class DependencyHolder(InterpreterObject, ObjectHolder): return self.held_object.get_pkgconfig_variable(varname, kwargs) @FeatureNew('dep.get_configtool_variable', '0.44.0') + @FeatureDeprecated('Dependency.get_configtool_variable', '0.56.0', + 'use Dependency.get_variable(configtool : ...) instead') @permittedKwargs({}) def configtool_method(self, args, kwargs): args = listify(args) |