ninja backend: Adjust naming and comments

Meson supports other transpilers generating source code for which
compilation rules need to be generated other than Vala. Reflect this
in variable names and comments to avoid confusion.
pull/12573/merge
Daniele Nicolodi 12 months ago committed by Dylan Baker
parent c2ea14fbd2
commit 76ab2db086
  1. 23
      mesonbuild/backend/ninjabackend.py

@ -993,13 +993,15 @@ class NinjaBackend(backends.Backend):
fortran_inc_args = mesonlib.listify([target.compilers['fortran'].get_include_args( fortran_inc_args = mesonlib.listify([target.compilers['fortran'].get_include_args(
self.get_target_private_dir(t), is_system=False) for t in obj_targets]) self.get_target_private_dir(t), is_system=False) for t in obj_targets])
# Generate compilation targets for C sources generated from Vala # Generate compilation targets for sources generated by transpilers.
# sources. This can be extended to other $LANG->C compilers later if
# necessary. This needs to be separate for at least Vala
# #
# Do not try to unity-build the generated c files from vala, as these # Do not try to unity-build the generated source files, as these
# often contain duplicate symbols and will fail to compile properly # often contain duplicate symbols and will fail to compile properly.
vala_generated_source_files = [] #
# Gather all generated source files and header before generating the
# compilation rules, to be able to add correct dependencies on the
# generated headers.
transpiled_source_files = []
for src in transpiled_sources: for src in transpiled_sources:
raw_src = File.from_built_relative(src) raw_src = File.from_built_relative(src)
# Generated targets are ordered deps because the must exist # Generated targets are ordered deps because the must exist
@ -1010,13 +1012,8 @@ class NinjaBackend(backends.Backend):
if self.environment.is_header(src): if self.environment.is_header(src):
header_deps.append(raw_src) header_deps.append(raw_src)
else: else:
# We gather all these and generate compile rules below transpiled_source_files.append(raw_src)
# after `header_deps` (above) is fully generated for src in transpiled_source_files:
vala_generated_source_files.append(raw_src)
for src in vala_generated_source_files:
# Passing 'vala' here signifies that we want the compile
# arguments to be specialized for C code generated by
# valac. For instance, no warnings should be emitted.
o, s = self.generate_single_compile(target, src, True, [], header_deps) o, s = self.generate_single_compile(target, src, True, [], header_deps)
obj_list.append(o) obj_list.append(o)

Loading…
Cancel
Save