aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/ninjabackend.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/backend/ninjabackend.py')
-rw-r--r--mesonbuild/backend/ninjabackend.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index a29af60..f8c8109 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -233,7 +233,7 @@ int dummy;
if isinstance(target, build.RunTarget):
self.generate_run_target(target, outfile)
name = target.get_id()
- gen_src_deps = []
+ vala_gen_sources = []
if name in self.processed_targets:
return
if isinstance(target, build.Jar):
@@ -249,8 +249,7 @@ int dummy;
self.generate_swift_target(target, outfile)
return
if 'vala' in target.compilers:
- vala_output_files = self.generate_vala_compile(target, outfile)
- gen_src_deps += vala_output_files
+ vala_gen_sources = self.generate_vala_compile(target, outfile)
self.scan_fortran_module_outputs(target)
self.process_target_dependencies(target, outfile)
self.generate_custom_generator_rules(target, outfile)
@@ -318,9 +317,10 @@ int dummy;
src_list.append(src)
obj_list.append(self.generate_single_compile(target, outfile, src, True,
header_deps=header_deps))
- # Generate compilation targets for sources belonging to this target that
- # are generated by other rules (this is only used for Vala right now)
- for src in gen_src_deps:
+ # Generate compilation targets for C sources generated from Vala
+ # sources. This can be extended to other $LANG->C compilers later if
+ # necessary.
+ for src in vala_gen_sources:
src_list.append(src)
if is_unity:
unity_src.append(os.path.join(self.environment.get_build_dir(), src))
@@ -334,7 +334,7 @@ int dummy;
if self.environment.is_header(src):
header_deps.append(src)
else:
- obj_list.append(self.generate_single_compile(target, outfile, src, True, [], header_deps))
+ obj_list.append(self.generate_single_compile(target, outfile, src, 'vala', [], header_deps))
# Generate compile targets for all the pre-existing sources for this target
for src in target.get_sources():
if src.endswith('.vala'):
@@ -1614,7 +1614,11 @@ rule FORTRAN_DEP_HACK
commands += sargs
for d in i.get_extra_build_dirs():
commands += compiler.get_include_args(d, i.is_system)
- commands += self.generate_basic_compiler_args(target, compiler)
+ commands += self.generate_basic_compiler_args(target, compiler,
+ # The code generated by valac is usually crap
+ # and has tons of unused variables and such,
+ # so disable warnings for Vala C sources.
+ no_warn_args=(is_generated == 'vala'))
for d in target.external_deps:
if d.need_threads():
commands += compiler.thread_flags()