aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2015-05-02 15:47:03 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2015-05-02 15:47:03 +0300
commitc78f8c994588c37c65413ef69e1f0e210bff20a4 (patch)
tree89af055b86382c59222cf5d8f4e8b5fcca410abe
parent9117e2b076399e56d3c74642ca1c1f4731339131 (diff)
downloadmeson-c78f8c994588c37c65413ef69e1f0e210bff20a4.zip
meson-c78f8c994588c37c65413ef69e1f0e210bff20a4.tar.gz
meson-c78f8c994588c37c65413ef69e1f0e210bff20a4.tar.bz2
Renamed file function to files and made it take multiple arguments.
-rw-r--r--interpreter.py10
-rw-r--r--test cases/common/81 file object/meson.build4
-rw-r--r--test cases/common/81 file object/subdir1/meson.build4
-rw-r--r--test cases/common/81 file object/subdir2/meson.build4
4 files changed, 9 insertions, 13 deletions
diff --git a/interpreter.py b/interpreter.py
index 6de2d54..7e1f887 100644
--- a/interpreter.py
+++ b/interpreter.py
@@ -787,7 +787,7 @@ class Interpreter():
'vcs_tag' : self.func_vcs_tag,
'set_variable' : self.func_set_variable,
'import' : self.func_import,
- 'file' : self.func_file,
+ 'files' : self.func_files,
}
def module_method_callback(self, invalues):
@@ -890,12 +890,8 @@ class Interpreter():
@stringArgs
@noKwargs
- def func_file(self, node, args, kwargs):
- if len(args) != 1:
- raise InvalidCode('File takes one argument.')
- fname = args[0]
- fobj = File.from_source_file(self.environment.source_dir, self.subdir, fname)
- return fobj
+ def func_files(self, node, args, kwargs):
+ return [File.from_source_file(self.environment.source_dir, self.subdir, fname) for fname in args]
def set_variable(self, varname, variable):
if variable is None:
diff --git a/test cases/common/81 file object/meson.build b/test cases/common/81 file object/meson.build
index 152901c..c3ecb7b 100644
--- a/test cases/common/81 file object/meson.build
+++ b/test cases/common/81 file object/meson.build
@@ -1,7 +1,7 @@
project('file object', 'c')
-prog0 = file('prog.c')
-lib0 = file('lib.c')
+prog0 = files('prog.c')
+lib0 = files('lib.c')
test('fobj', executable('fobj', prog0, lib0))
subdir('subdir1')
diff --git a/test cases/common/81 file object/subdir1/meson.build b/test cases/common/81 file object/subdir1/meson.build
index e41a824..f5066f0 100644
--- a/test cases/common/81 file object/subdir1/meson.build
+++ b/test cases/common/81 file object/subdir1/meson.build
@@ -1,5 +1,5 @@
-prog1 = file('prog.c')
-lib1 = file('lib.c')
+prog1 = files('prog.c')
+lib1 = files('lib.c')
test('subdir0', executable('subdir0', prog0, lib1), should_fail : true)
test('subdir1', executable('subdir1', prog1, lib0), should_fail : true)
diff --git a/test cases/common/81 file object/subdir2/meson.build b/test cases/common/81 file object/subdir2/meson.build
index 06f0e49..5886510 100644
--- a/test cases/common/81 file object/subdir2/meson.build
+++ b/test cases/common/81 file object/subdir2/meson.build
@@ -1,5 +1,5 @@
-prog2 = file('prog.c')
-lib2 = file('lib.c')
+prog2 = files('prog.c')
+lib2 = files('lib.c')
test('subdir3', executable('subdir3', prog1, lib2), should_fail : true)
test('subdir4', executable('subdir4', prog2, lib1), should_fail : true)