diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2016-11-16 22:03:26 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2016-11-18 17:37:35 -0500 |
commit | a01919976eb08277bad78bb22937601cf5a862e0 (patch) | |
tree | e366cba35d5e16664c5e3557fd44eb5f17149b07 /mesonbuild/mesonlib.py | |
parent | 996f4d89f3d60731306a6a72b339eb5c2dbb5020 (diff) | |
download | meson-a01919976eb08277bad78bb22937601cf5a862e0.zip meson-a01919976eb08277bad78bb22937601cf5a862e0.tar.gz meson-a01919976eb08277bad78bb22937601cf5a862e0.tar.bz2 |
Always specify installed data with a File object. Closes #858.
Diffstat (limited to 'mesonbuild/mesonlib.py')
-rw-r--r-- | mesonbuild/mesonlib.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py index 943a23e..b92be5f 100644 --- a/mesonbuild/mesonlib.py +++ b/mesonbuild/mesonlib.py @@ -58,6 +58,12 @@ class File: else: return os.path.join(build_to_src, self.subdir, self.fname) + def absolute_path(self, srcdir, builddir): + if self.is_built: + return os.path.join(builddir, self.subdir, self.fname) + else: + return os.path.join(srcdir, self.subdir, self.fname) + def endswith(self, ending): return self.fname.endswith(ending) @@ -70,6 +76,9 @@ class File: def __hash__(self): return hash((self.fname, self.subdir, self.is_built)) + def relative_name(self): + return os.path.join(self.subdir, self.fname) + def get_compiler_for_source(compilers, src): for comp in compilers: if comp.can_compile(src): |