summaryrefslogtreecommitdiff
path: root/mesonbuild/backend
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2025-07-21 12:15:46 +0200
committerJussi Pakkanen <jussi.pakkanen@mailbox.org>2025-07-29 21:58:47 +0300
commit9b40c5fe4a9899daa214c736726ca4739138e24a (patch)
treee306b9f34dd8aea29f9e320f0cde3e9a49105c78 /mesonbuild/backend
parent0237e2f3f954ec718638077bc4c356532739d93f (diff)
downloadmeson-9b40c5fe4a9899daa214c736726ca4739138e24a.tar.gz
ninjabackend: handle specially TUs where compilation and linking happens together
Rust sources are not compiled separately: generation of the .a or .so or binary happens at the same time as compilation. There is no separate compilation phase where the .o file is created. In preparation for moving generate_rust_target where generate_link is now, make the compilation phase of generate_target skip them. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'mesonbuild/backend')
-rw-r--r--mesonbuild/backend/ninjabackend.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index 2b4bfd92b..a9f0bbb6a 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -993,6 +993,8 @@ class NinjaBackend(backends.Backend):
# this target. We create the Ninja build file elements for this here
# because we need `header_deps` to be fully generated in the above loop.
for src in generated_source_files:
+ if not self.environment.is_separate_compile(src):
+ continue
if self.environment.is_llvm_ir(src):
o, s = self.generate_llvm_ir_compile(target, src)
else:
@@ -1051,6 +1053,8 @@ class NinjaBackend(backends.Backend):
# Generate compile targets for all the preexisting sources for this target
for src in target_sources.values():
+ if not self.environment.is_separate_compile(src):
+ continue
if self.environment.is_header(src) and not is_compile_target:
continue
if self.environment.is_llvm_ir(src):