summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniele Nicolodi <daniele@grinta.net>2023-12-09 11:21:55 +0100
committerDylan Baker <dylan@pnwbakers.com>2023-12-09 23:45:05 -0800
commit76ab2db0863d85eb92933067a034c33962091286 (patch)
tree5efb1b65236a36e1c6e33215c4e8d048d5ec5ad2
parentc2ea14fbd2af448136cc8af65a9a4da13a39d35c (diff)
downloadmeson-76ab2db0863d85eb92933067a034c33962091286.tar.gz
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.
-rw-r--r--mesonbuild/backend/ninjabackend.py23
1 files changed, 10 insertions, 13 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index c5c208661..0e5697740 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -993,13 +993,15 @@ class NinjaBackend(backends.Backend):
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])
- # Generate compilation targets for C sources generated from Vala
- # sources. This can be extended to other $LANG->C compilers later if
- # necessary. This needs to be separate for at least Vala
+ # Generate compilation targets for sources generated by transpilers.
#
- # Do not try to unity-build the generated c files from vala, as these
- # often contain duplicate symbols and will fail to compile properly
- vala_generated_source_files = []
+ # Do not try to unity-build the generated source files, as these
+ # often contain duplicate symbols and will fail to compile properly.
+ #
+ # 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:
raw_src = File.from_built_relative(src)
# Generated targets are ordered deps because the must exist
@@ -1010,13 +1012,8 @@ class NinjaBackend(backends.Backend):
if self.environment.is_header(src):
header_deps.append(raw_src)
else:
- # We gather all these and generate compile rules below
- # after `header_deps` (above) is fully generated
- 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.
+ transpiled_source_files.append(raw_src)
+ for src in transpiled_source_files:
o, s = self.generate_single_compile(target, src, True, [], header_deps)
obj_list.append(o)