diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2021-01-19 10:12:38 -0800 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2021-01-19 10:12:38 -0800 |
commit | 3ae115b57ad7f8eca09c03f5bd6bf65604dcaf59 (patch) | |
tree | 7e2c18c073c0b6d2463114d4d6ee9ce5633fd57a /mesonbuild/backend/ninjabackend.py | |
parent | c64d4070763b2daf82a50a7b4f5b130b2bb91062 (diff) | |
download | meson-3ae115b57ad7f8eca09c03f5bd6bf65604dcaf59.zip meson-3ae115b57ad7f8eca09c03f5bd6bf65604dcaf59.tar.gz meson-3ae115b57ad7f8eca09c03f5bd6bf65604dcaf59.tar.bz2 |
Replace NinjaBackend is_rust_target with build.uses_rust
we have two functions to do the exact same thing, and they're basically
implemented the same way. Instead, let's just use the BuildTarget one,
as it's more generally available.
Diffstat (limited to 'mesonbuild/backend/ninjabackend.py')
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index d66708c..d3350bb 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -691,13 +691,6 @@ int dummy; src_block['sources'] += sources src_block['generated_sources'] += generated_sources - def is_rust_target(self, target): - if len(target.sources) > 0: - first_file = target.sources[0] - if first_file.fname.endswith('.rs'): - return True - return False - def generate_target(self, target): try: if isinstance(target, build.BuildTarget): @@ -723,7 +716,7 @@ int dummy; if isinstance(target, build.Jar): self.generate_jar_target(target) return - if self.is_rust_target(target): + if target.uses_rust(): self.generate_rust_target(target) return if 'cs' in target.compilers: |