Added methods to get source and build root directories.

pull/139/head
Jussi Pakkanen 10 years ago
parent 9c9ab25190
commit d170780b7e
  1. 2
      dependencies.py
  2. 8
      interpreter.py

@ -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):

@ -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

Loading…
Cancel
Save