diff options
| -rw-r--r-- | mesonbuild/backend/ninjabackend.py | 4 | ||||
| -rw-r--r-- | test cases/rust/13 external c dependencies/foo.h | 3 | ||||
| -rw-r--r-- | test cases/rust/13 external c dependencies/meson.build | 7 |
3 files changed, 12 insertions, 2 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index db061f286..a47a948ee 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -1985,7 +1985,7 @@ class NinjaBackend(backends.Backend): return orderdeps, main_rust_file for i in target.get_sources(): - if main_rust_file is None: + if main_rust_file is None and i.endswith('.rs'): main_rust_file = i.rel_to_builddir(self.build_to_src) for g in target.get_generated_sources(): for i in g.get_outputs(): @@ -1993,7 +1993,7 @@ class NinjaBackend(backends.Backend): fname = os.path.join(self.get_target_private_dir(target), i) else: fname = os.path.join(g.get_subdir(), i) - if main_rust_file is None: + if main_rust_file is None and fname.endswith('.rs'): main_rust_file = fname orderdeps.append(fname) diff --git a/test cases/rust/13 external c dependencies/foo.h b/test cases/rust/13 external c dependencies/foo.h new file mode 100644 index 000000000..891255215 --- /dev/null +++ b/test cases/rust/13 external c dependencies/foo.h @@ -0,0 +1,3 @@ +#pragma once + +int foo; diff --git a/test cases/rust/13 external c dependencies/meson.build b/test cases/rust/13 external c dependencies/meson.build index c91674caa..d0baab42d 100644 --- a/test cases/rust/13 external c dependencies/meson.build +++ b/test cases/rust/13 external c dependencies/meson.build @@ -21,3 +21,10 @@ e = executable( ) test('cdepstest', e) + +e2 = executable( + 'prog2', 'prog.rs', + dependencies : declare_dependency(link_with: l, sources: files('foo.h')), +) + +test('cdepstest', e2) |
