Allow custom targets with same name in project and subprojects

closes #4377
pull/4955/head
Raphael Salamon 6 years ago committed by Jussi Pakkanen
parent 37a962e90c
commit c23ac0b3dc
  1. 3
      mesonbuild/build.py
  2. 4
      run_unittests.py
  3. 1
      test cases/common/87 identical target name in subproject/meson.build
  4. 1
      test cases/common/87 identical target name in subproject/subprojects/foo/meson.build

@ -1890,9 +1890,6 @@ class CustomTarget(Target):
repr_str = "<{0} {1}: {2}>"
return repr_str.format(self.__class__.__name__, self.get_id(), self.command)
def get_id(self):
return self.name + self.type_suffix()
def get_target_dependencies(self):
deps = self.dependencies[:]
deps += self.extra_depends

@ -2677,7 +2677,7 @@ int main(int argc, char **argv) {
self.init(testdir)
expected = {
'bindat@cus': ['data_source.txt'],
'depfile@cus': [],
'a685fbc@@depfile@cus': [],
}
t_intro = self.introspect('--targets')
self.assertCountEqual([t['id'] for t in t_intro], expected)
@ -4577,7 +4577,7 @@ class LinuxlikeTests(BasePlatformTests):
docbook_target = t
break
self.assertIsInstance(docbook_target, dict)
ifile = self.introspect(['--target-files', 'generated-gdbus-docbook@cus'])[0]
ifile = self.introspect(['--target-files', '8d60afc@@generated-gdbus-docbook@cus'])[0]
self.assertListEqual(t['filename'], [os.path.join(self.builddir, 'gdbus/generated-gdbus-doc-' + os.path.basename(ifile))])
def test_build_rpath(self):

@ -4,3 +4,4 @@ subproject('foo')
executable('bar', 'bar.c')
run_target('nop', command : ['true'])
custom_target('cus', output: ['cus.c'], command : ['true'])

@ -2,3 +2,4 @@ project('subfoo', 'c')
executable('bar', 'bar.c')
run_target('nop', command : ['true'])
custom_target('cus', output: ['cus.c'], command : ['true'])

Loading…
Cancel
Save