Split generator @BASENAME@ at the first extension.

pull/914/head
Elliott Sales de Andrade 8 years ago committed by Jussi Pakkanen
parent abfc95e75a
commit 779788ad82
  1. 4
      mesonbuild/build.py
  2. 4
      test cases/common/118 allgenerate/meson.build

@ -761,14 +761,14 @@ class Generator():
def get_base_outnames(self, inname):
plainname = os.path.split(inname)[1]
basename = plainname.split('.')[0]
basename = os.path.splitext(plainname)[0]
return [x.replace('@BASENAME@', basename).replace('@PLAINNAME@', plainname) for x in self.outputs]
def get_dep_outname(self, inname):
if self.depfile is None:
raise InvalidArguments('Tried to get dep name for rule that does not have dependency file defined.')
plainname = os.path.split(inname)[1]
basename = plainname.split('.')[0]
basename = os.path.splitext(plainname)[0]
return self.depfile.replace('@BASENAME@', basename).replace('@PLAINNAME@', plainname)
def get_arglist(self):

@ -5,7 +5,7 @@ project('all sources generated', 'c', 'cpp')
comp = find_program('converter.py')
g = generator(comp,
output : '@BASENAME@.cpp',
output : '@BASENAME@',
arguments : ['@INPUT@', '@OUTPUT@'])
c = g.process('foobar.cpp.in')
@ -17,4 +17,4 @@ c2 = custom_target('c2gen',
input : 'foobar.cpp.in',
command : [comp, '@INPUT@', '@OUTPUT@'])
prog2 = executable('genexe2', c2)
prog2 = executable('genexe2', c2)

Loading…
Cancel
Save