aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/environment.py
diff options
context:
space:
mode:
authorMichael Hirsch, Ph.D <scivision@users.noreply.github.com>2019-11-10 09:26:55 -0500
committerMichael Hirsch, Ph.D <scivision@users.noreply.github.com>2020-02-05 13:23:55 -0500
commitc2e6565029779b749dc3423291524115af1b2bd7 (patch)
treed8690f58aa0b70f73f6d7ae2c420aa6f2a71900a /mesonbuild/environment.py
parentdc8d2415836953a8e7fbb06931d34caab1bb2bfb (diff)
downloadmeson-c2e6565029779b749dc3423291524115af1b2bd7.zip
meson-c2e6565029779b749dc3423291524115af1b2bd7.tar.gz
meson-c2e6565029779b749dc3423291524115af1b2bd7.tar.bz2
add meson.get_native_property for native files
This allows Meson native-file [properties] to be used. This avoids the need to call meson from a script file or have a long command line invocation of `meson setup` The method meson.get_native_property('prop', 'fallback') is added. The native file can contain properties like ``` [properties] myprop1 = 'foo' mydir2 = 'lib/custom' ``` Then from within `meson.build` ```meson x1 = meson.get_native_property('myprop1') thedir = meson.get_native_property('mydir2', 'libs') ``` fallback values are optional
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r--mesonbuild/environment.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index beaff76..554d79b 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -538,6 +538,7 @@ class Environment:
coredata.load_configs(self.coredata.config_files))
binaries.build = BinaryTable(config.get('binaries', {}))
paths.build = Directories(**config.get('paths', {}))
+ properties.build = Properties(config.get('properties', {}))
## Read in cross file(s) to override host machine configuration