diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2013-01-13 19:25:54 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2013-01-13 19:25:54 +0200 |
commit | 57015296328a4fe5c8bad5410a3b4ba67637fbb6 (patch) | |
tree | 91bf8d1091715884259f2a945bdb22a0eab21760 /interpreter.py | |
parent | 0783c7ff97da9fbb7b9883a5b392d6f2348f8119 (diff) | |
download | meson-57015296328a4fe5c8bad5410a3b4ba67637fbb6.zip meson-57015296328a4fe5c8bad5410a3b4ba67637fbb6.tar.gz meson-57015296328a4fe5c8bad5410a3b4ba67637fbb6.tar.bz2 |
Can install data files.
Diffstat (limited to 'interpreter.py')
-rwxr-xr-x | interpreter.py | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/interpreter.py b/interpreter.py index 7707b82..293db9e 100755 --- a/interpreter.py +++ b/interpreter.py @@ -54,7 +54,21 @@ class Headers(InterpreterObject): def get_sources(self): return self.sources + +class Data(InterpreterObject): + def __init__(self, subdir, sources): + InterpreterObject.__init__(self) + self.subdir = subdir + self.sources = sources + + def get_subdir(self): + return self.subdir + + def get_sources(self): + return self.sources + + class Man(InterpreterObject): def __init__(self, sources): @@ -185,7 +199,8 @@ class Interpreter(): 'add_test' : self.func_add_test, 'headers' : self.func_headers, 'man' : self.func_man, - 'subdir' : self.func_subdir + 'subdir' : self.func_subdir, + 'data' : self.func_data } def sanity_check_ast(self): @@ -310,6 +325,16 @@ class Interpreter(): self.evaluate_codeblock(codeblock) self.subdir = prev_subdir + def func_data(self, node, args): + if len(args ) < 2: + raise InvalidArguments('Line %d: Data function must have at least two arguments: name and source file(s)' % node.lineno()) + for a in args: + if not isinstance(a, str): + raise InvalidArguments('Line %d: Argument %s is not a string.' % (node.lineno(), str(a))) + data = Data(args[0], args[1:]) + self.build.data.append(data) + return data + def build_target(self, node, args, targetclass): for a in args: if not isinstance(a, str): |