From bb6446f0c07877b5bea43cb74ec8babaff8a398d Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Sat, 22 Mar 2014 16:46:38 +0200 Subject: [PATCH] Minor. --- backends.py | 5 +---- build.py | 6 +++++- test cases/common/29 pipeline/meson.build | 1 + test cases/common/30 pipeline/meson.build | 1 + 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/backends.py b/backends.py index cc83776c1..5cf8c0553 100644 --- a/backends.py +++ b/backends.py @@ -242,7 +242,7 @@ class Backend(): unity_src.append(abs_src) else: obj_list.append(self.generate_single_compile(target, outfile, src, False, header_deps)) - obj_list += self.flatten_obj_list(target) + obj_list += self.flatten_object_list(target) if is_unity: for src in self.generate_unity_files(target, unity_src): obj_list.append(self.generate_single_compile(target, outfile, src, True, unity_deps + header_deps)) @@ -938,9 +938,6 @@ class NinjaBackend(Backend): if len(infilelist) == len(outfilelist): sole_output = os.path.join(self.get_target_private_dir(target), outfilelist[i]) else: - for x in base_args: - if '@OUTPUT@' in x: - raise MesonException('Tried to use @OUTPUT@ in a rule with more than one output.') sole_output = '' curfile = infilelist[i] infilename = os.path.join(self.environment.get_source_dir(), curfile) diff --git a/build.py b/build.py index fe3eff5b1..be50b396b 100644 --- a/build.py +++ b/build.py @@ -387,7 +387,7 @@ class Generator(): def __init__(self, args, kwargs): if len(args) != 1: raise InvalidArguments('Generator requires one and only one positional argument') - + if hasattr(args[0], 'held_object'): exe = args[0].held_object if not isinstance(exe, Executable): @@ -427,6 +427,10 @@ class Generator(): raise InvalidArguments('"outputs" must contain @BASENAME@ or @PLAINNAME@.') if '/' in rule or '\\' in rule: raise InvalidArguments('"outputs" must not contain a directory separator.') + if len(outputs) > 1: + for o in outputs: + if '@OUTPUT@' in o: + raise InvalidArguments('Tried to use @OUTPUT@ in a rule with more than one output.') self.outputs = outputs def get_base_outnames(self, inname): diff --git a/test cases/common/29 pipeline/meson.build b/test cases/common/29 pipeline/meson.build index 813c209e9..aebfbec66 100644 --- a/test cases/common/29 pipeline/meson.build +++ b/test cases/common/29 pipeline/meson.build @@ -4,6 +4,7 @@ project('pipeline test', 'c') # the host compiler. e1 = executable('srcgen', 'srcgen.c', native : true) +# Generate a source file that needs to be included in the build. gen = generator(e1, \ outputs : '@BASENAME@.c', # Line continuation inside arguments should work without needing a "\". arguments : ['@INPUT@', '@OUTPUT@']) diff --git a/test cases/common/30 pipeline/meson.build b/test cases/common/30 pipeline/meson.build index 2f34bd410..0a51f72c8 100644 --- a/test cases/common/30 pipeline/meson.build +++ b/test cases/common/30 pipeline/meson.build @@ -2,6 +2,7 @@ project('pipeline test', 'c') e1 = executable('srcgen', 'srcgen.c', native : true) +# Generate a header file that needs to be included. gen = generator(e1, outputs : '@BASENAME@.h', arguments : ['@INPUT@', '@OUTPUT@'])