Keyword argument unification.

pull/15/head
Jussi Pakkanen 11 years ago
parent 8467c5b0a6
commit 51b73e8ab2
  1. 8
      build.py
  2. 2
      test cases/common/29 pipeline/meson.build
  3. 2
      test cases/common/30 pipeline/meson.build
  4. 2
      test cases/common/31 find program/meson.build
  5. 2
      test cases/frameworks/5 protocol buffers/meson.build

@ -433,14 +433,14 @@ class Generator():
raise InvalidArguments('A non-string object in "arguments" keyword argument.')
self.arglist = args
if 'outputs' not in kwargs:
raise InvalidArguments('Generator must have "outputs" keyword argument.')
outputs = kwargs['outputs']
if 'output' not in kwargs:
raise InvalidArguments('Generator must have "output" keyword argument.')
outputs = kwargs['output']
if not isinstance(outputs, list):
outputs = [outputs]
for rule in outputs:
if not isinstance(rule, str):
raise InvalidArguments('"outputs" may only contain strings.')
raise InvalidArguments('"output" may only contain strings.')
if not '@BASENAME@' in rule and not '@PLAINNAME@' in rule:
raise InvalidArguments('"outputs" must contain @BASENAME@ or @PLAINNAME@.')
if '/' in rule or '\\' in rule:

@ -6,7 +6,7 @@ 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 "\".
output : '@BASENAME@.c', # Line continuation inside arguments should work without needing a "\".
arguments : ['@INPUT@', '@OUTPUT@'])
generated = gen.process('input_src.dat')

@ -4,7 +4,7 @@ e1 = executable('srcgen', 'srcgen.c', native : true)
# Generate a header file that needs to be included.
gen = generator(e1,
outputs : '@BASENAME@.h',
output : '@BASENAME@.h',
arguments : ['@INPUT@', '@OUTPUT@'])
generated = gen.process('input_src.dat')

@ -11,7 +11,7 @@ if build.name() == 'windows'
else
cp = find_program('cp')
gen = generator(cp, \
outputs : '@BASENAME@.c', \
output : '@BASENAME@.c', \
arguments : ['@INPUT@', '@OUTPUT@'])
generated = gen.process('source.in')

@ -4,7 +4,7 @@ protoc = find_program('protoc')
dep = dependency('protobuf')
gen = generator(protoc, \
outputs : ['@BASENAME@.pb.cc', '@BASENAME@.pb.h'],
output : ['@BASENAME@.pb.cc', '@BASENAME@.pb.h'],
arguments : ['-I=@SOURCE_DIR@', '--cpp_out=@BUILD_DIR@', '@INPUT@'])
generated = gen.process('defs.proto')

Loading…
Cancel
Save