diff --git a/interpreter.py b/interpreter.py index 6de2d54b7..7e1f887f6 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 152901cb7..c3ecb7be9 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 e41a82426..f5066f00f 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 06f0e4911..588651019 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)