aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2021-04-09 08:46:01 -0400
committerDylan Baker <dylan@pnwbakers.com>2021-04-09 09:29:12 -0700
commit5440ce003b5ffad9220496df910a52fb9d798a91 (patch)
treef61c94809ffafa9cbab0a1d9ccf258c28d1c0ae6 /mesonbuild
parentf328632fa500aaa085b63712414bdd1b890aaf0b (diff)
downloadmeson-5440ce003b5ffad9220496df910a52fb9d798a91.zip
meson-5440ce003b5ffad9220496df910a52fb9d798a91.tar.gz
meson-5440ce003b5ffad9220496df910a52fb9d798a91.tar.bz2
Add global_source/build_root()
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/interpreter/mesonmain.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/mesonbuild/interpreter/mesonmain.py b/mesonbuild/interpreter/mesonmain.py
index eef1ccf..e76ad2e 100644
--- a/mesonbuild/interpreter/mesonmain.py
+++ b/mesonbuild/interpreter/mesonmain.py
@@ -35,6 +35,8 @@ class MesonMain(InterpreterObject):
'build_root': self.build_root_method,
'project_source_root': self.project_source_root_method,
'project_build_root': self.project_build_root_method,
+ 'global_source_root': self.global_source_root_method,
+ 'global_build_root': self.global_build_root_method,
'add_install_script': self.add_install_script_method,
'add_postconf_script': self.add_postconf_script_method,
'add_dist_script': self.add_dist_script_method,
@@ -173,13 +175,13 @@ class MesonMain(InterpreterObject):
@noPosargs
@permittedKwargs({})
- @FeatureDeprecated('meson.source_root', '0.56.0', 'use meson.current_source_dir instead.')
+ @FeatureDeprecated('meson.source_root', '0.56.0', 'use meson.project_source_root() or meson.global_source_root() instead.')
def source_root_method(self, args, kwargs):
return self.interpreter.environment.source_dir
@noPosargs
@permittedKwargs({})
- @FeatureDeprecated('meson.build_root', '0.56.0', 'use meson.current_build_dir instead.')
+ @FeatureDeprecated('meson.build_root', '0.56.0', 'use meson.project_build_root() or meson.global_build_root() instead.')
def build_root_method(self, args, kwargs):
return self.interpreter.environment.build_dir
@@ -204,6 +206,18 @@ class MesonMain(InterpreterObject):
return os.path.join(src, sub)
@noPosargs
+ @noKwargs
+ @FeatureNew('meson.global_source_root', '0.58.0')
+ def global_source_root_method(self, args, kwargs):
+ return self.interpreter.environment.source_dir
+
+ @noPosargs
+ @noKwargs
+ @FeatureNew('meson.global_build_root', '0.58.0')
+ def global_build_root_method(self, args, kwargs):
+ return self.interpreter.environment.build_dir
+
+ @noPosargs
@permittedKwargs({})
@FeatureDeprecated('meson.has_exe_wrapper', '0.55.0', 'use meson.can_run_host_binaries instead.')
def has_exe_wrapper_method(self, args: T.Tuple[object, ...], kwargs: T.Dict[str, object]) -> bool: