diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2015-04-22 15:53:46 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2015-04-22 15:53:46 +0300 |
commit | 6237695e96eb57123ab7f02b37b031dd516dbe93 (patch) | |
tree | 67522ebfa8faf083dbe8424f436d29fcddcfcc4e /interpreter.py | |
parent | bf9b5d7b726c9388e5204fb44969fd11730944c6 (diff) | |
download | meson-6237695e96eb57123ab7f02b37b031dd516dbe93.zip meson-6237695e96eb57123ab7f02b37b031dd516dbe93.tar.gz meson-6237695e96eb57123ab7f02b37b031dd516dbe93.tar.bz2 |
Use File objects for all sources. Fix all basic tests.
Diffstat (limited to 'interpreter.py')
-rw-r--r-- | interpreter.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/interpreter.py b/interpreter.py index 647cc52..f33fff3 100644 --- a/interpreter.py +++ b/interpreter.py @@ -1494,6 +1494,19 @@ class Interpreter(): result.append(a) return result + def source_strings_to_files(self, sources): + results = [] + for s in sources: + if isinstance(s, File) or isinstance(s, GeneratedListHolder) or \ + isinstance(s, CustomTargetHolder): + pass + elif isinstance(s, str): # FIXME do not allow plain strings. + s = File.from_source_file(self.environment.source_dir, self.subdir, s) + else: + raise RuntimeError("Unreachable code") + results.append(s) + return results + def build_target(self, node, args, kwargs, targetholder): args = self.flatten(args) name = args[0] @@ -1515,6 +1528,7 @@ class Interpreter(): except KeyError: kw_src = [] sources += kw_src + sources = self.source_strings_to_files(sources) objs = self.flatten(kwargs.get('objects', [])) if not isinstance(objs, list): objs = [objs] |