diff options
Diffstat (limited to 'backends.py')
-rw-r--r-- | backends.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/backends.py b/backends.py index 03ecd4b..70b206a 100644 --- a/backends.py +++ b/backends.py @@ -132,23 +132,23 @@ class Backend(): self.write_benchmark_file(datafile) datafile.close() - def has_vala(self, target): + def has_source_suffix(self, target, suffix): for s in target.get_sources(): - if s.endswith('.vala'): + if s.endswith(suffix): return True return False + def has_vala(self, target): + return self.has_source_suffix(target, '.vala') + def has_rust(self, target): - for s in target.get_sources(): - if s.endswith('.rs'): - return True - return False + return self.has_source_suffix(target, '.rs') def has_cs(self, target): - for s in target.get_sources(): - if s.endswith('.cs'): - return True - return False + return self.has_source_suffix(target, '.cs') + + def has_swift(self, target): + return self.has_source_suffix(target, '.swift') def determine_linker(self, target, src): if isinstance(target, build.StaticLibrary): |