diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2021-02-25 13:45:23 -0800 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2021-02-25 15:18:39 -0800 |
commit | aa4efc709e8e6773830d47a4a0ecce0313158a57 (patch) | |
tree | 5504bafad061c76cd88f3ccc5223b1f4cfee6dec | |
parent | 542dea25710fec8df0430d9b777bb15414e15b22 (diff) | |
download | meson-aa4efc709e8e6773830d47a4a0ecce0313158a57.zip meson-aa4efc709e8e6773830d47a4a0ecce0313158a57.tar.gz meson-aa4efc709e8e6773830d47a4a0ecce0313158a57.tar.bz2 |
deprecated `meson.get_cross_property`
It's a pure subset of `get_external_property`, and has odd behavior in
host == build configurations. `get_external_property` is clear, and uses
the standard `native : bool` syntax to control host vs build properties
-rw-r--r-- | docs/markdown/Cross-compilation.md | 2 | ||||
-rw-r--r-- | docs/markdown/Reference-manual.md | 6 | ||||
-rw-r--r-- | docs/markdown/snippets/deprecated_get_cross_property.md | 5 | ||||
-rw-r--r-- | mesonbuild/interpreter.py | 1 |
4 files changed, 10 insertions, 4 deletions
diff --git a/docs/markdown/Cross-compilation.md b/docs/markdown/Cross-compilation.md index d4fb074..4410c03 100644 --- a/docs/markdown/Cross-compilation.md +++ b/docs/markdown/Cross-compilation.md @@ -315,7 +315,7 @@ somekey = 'somevalue' then you can access that using the `meson` object like this: ```meson -myvar = meson.get_cross_property('somekey') +myvar = meson.get_external_property('somekey') # myvar now has the value 'somevalue' ``` diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md index 4fb0b63..6669530 100644 --- a/docs/markdown/Reference-manual.md +++ b/docs/markdown/Reference-manual.md @@ -1979,9 +1979,9 @@ the following methods. the "native" compiler if we're not. - `get_cross_property(propname, fallback_value)`: - *Consider `get_external_property()` instead*. Returns the given - property from a cross file, the optional fallback_value is returned - if not cross compiling or the given property is not found. + *Deprecated since 0.58.0, use `get_external_property()` instead*. + Returns the given property from a cross file, the optional fallback_value + is returned if not cross compiling or the given property is not found. - `get_external_property(propname, fallback_value, native: true/false)` *(since 0.54.0)*: returns the given property from a native or cross file. diff --git a/docs/markdown/snippets/deprecated_get_cross_property.md b/docs/markdown/snippets/deprecated_get_cross_property.md new file mode 100644 index 0000000..8e62956 --- /dev/null +++ b/docs/markdown/snippets/deprecated_get_cross_property.md @@ -0,0 +1,5 @@ +## `meson.get_cross_property()` has been deprecated + +It's a pure subset of `meson.get_external_property`, and works strangely in +host == build configurations, since it would be more accurately described as +`get_host_property`. diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index e99500d..336613f 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -2241,6 +2241,7 @@ class MesonMain(InterpreterObject): @noArgsFlattening @permittedKwargs({}) + @FeatureDeprecated('meson.get_cross_property', '0.58.0', 'Use meson.get_external_property() instead') def get_cross_property_method(self, args, kwargs) -> str: if len(args) < 1 or len(args) > 2: raise InterpreterException('Must have one or two arguments.') |