Added methods to get source and build root directories.

This commit is contained in:
Jussi Pakkanen 2015-06-07 14:21:24 +03:00
parent 9c9ab25190
commit d170780b7e
2 changed files with 9 additions and 1 deletions

View File

@ -825,7 +825,7 @@ why. As a hack filter out everything that is not a flag."""
return self.libs
class AppleFrameworks(Dependency):
def __init__(self, kwargs):
def __init__(self, environment, kwargs):
Dependency.__init__(self)
modules = kwargs.get('modules', [])
if isinstance(modules, str):

View File

@ -679,6 +679,8 @@ class MesonMain(InterpreterObject):
'is_subproject' : self.is_subproject_method,
'current_source_dir' : self.current_source_dir_method,
'current_build_dir' : self.current_build_dir_method,
'source_root' : self.source_root_method,
'build_root' : self.build_root_method,
'set_install_script' : self.set_install_script_method,
})
@ -707,6 +709,12 @@ class MesonMain(InterpreterObject):
return src
return os.path.join(src, sub)
def source_root_method(self, args, kwargs):
return self.interpreter.environment.source_dir
def build_root_method(self, args, kwargs):
return self.interpreter.environment.build_dir
def has_exe_wrapper_method(self, args, kwargs):
if self.is_cross_build_method(None, None):
return 'exe_wrap' in self.build.environment.cross_info