ninjabackend: use get_subdir() instead of subdir attribute for cython

As this works correctly for CustomTarget, CustomTargetIndex, and
GeneratedList, but .subdir doesn't work for CustomTargetIndex.
pull/9285/head
Dylan Baker 3 years ago committed by Nirbheek Chauhan
parent bf99c5e718
commit 1d82002d65
  1. 2
      mesonbuild/backend/ninjabackend.py
  2. 10
      test cases/cython/2 generated sources/meson.build

@ -1601,7 +1601,7 @@ class NinjaBackend(backends.Backend):
# TODO: introspection? # TODO: introspection?
cython_sources.append(output) cython_sources.append(output)
else: else:
generated_sources[ssrc] = mesonlib.File.from_built_file(gen.subdir, ssrc) generated_sources[ssrc] = mesonlib.File.from_built_file(gen.get_subdir(), ssrc)
return static_sources, generated_sources, cython_sources return static_sources, generated_sources, cython_sources

@ -26,6 +26,16 @@ test(
env : ['PYTHONPATH=' + meson.current_build_dir()] env : ['PYTHONPATH=' + meson.current_build_dir()]
) )
# Test a CustomTargetIndex
cti = custom_target(
'cti',
input : 'gen.py',
output : 'cti.pyx',
command : [py3, '@INPUT@', '@OUTPUT@'],
)
cti_ext = py3.extension_module('cti', cti[0], dependencies : py3_dep)
cf = configure_file( cf = configure_file(
input : 'configure.pyx.in', input : 'configure.pyx.in',
output : 'cf.pyx', output : 'cf.pyx',

Loading…
Cancel
Save