diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2015-04-21 16:27:58 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2015-04-21 16:27:58 +0300 |
commit | bf9b5d7b726c9388e5204fb44969fd11730944c6 (patch) | |
tree | 9391fbac79ad1e5dfd9059c9a8bcfce5e00e6db5 /build.py | |
parent | a92fcb711b5b56ee6858d73dc90eda0e1e5d91a4 (diff) | |
download | meson-bf9b5d7b726c9388e5204fb44969fd11730944c6.zip meson-bf9b5d7b726c9388e5204fb44969fd11730944c6.tar.gz meson-bf9b5d7b726c9388e5204fb44969fd11730944c6.tar.bz2 |
The first step in a major refactoring starts by adding a new layer of abstraction.
Diffstat (limited to 'build.py')
-rw-r--r-- | build.py | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -17,7 +17,7 @@ import environment import dependencies import mlog import copy, os - +from mesonlib import File known_basic_kwargs = {'install' : True, 'c_pch' : True, @@ -207,7 +207,7 @@ class BuildTarget(): # Holder unpacking. Ugly. if hasattr(s, 'held_object'): s = s.held_object - if isinstance(s, str): + if isinstance(s, str) or isinstance(s, File): # FIXME, accept only File objects if not s in added_sources: self.sources.append(s) added_sources[s] = True @@ -218,7 +218,10 @@ class BuildTarget(): def validate_sources(self): if len(self.sources) > 0: - first = os.path.split(self.sources[0])[1] + firstname = self.sources[0] + if isinstance(firstname, File): + firstname = firstname.fname + first = os.path.split(firstname)[1] (base, suffix) = os.path.splitext(first) if suffix == '.rs': if self.name != base: |