aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/ninjabackend.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2019-03-22 23:40:52 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2019-03-24 20:56:06 +0200
commit8361da5c52e880225df50d209318ef2184c2dbb9 (patch)
treed6561a9ef4edd9a76f54a23773156a9d1ac7c70c /mesonbuild/backend/ninjabackend.py
parent3037ade41dc0cfc1cb84b0a668784c8d1af46987 (diff)
downloadmeson-8361da5c52e880225df50d209318ef2184c2dbb9.zip
meson-8361da5c52e880225df50d209318ef2184c2dbb9.tar.gz
meson-8361da5c52e880225df50d209318ef2184c2dbb9.tar.bz2
Fix setup so test suite runs with rustc + MSVC. Closes: 5099
Diffstat (limited to 'mesonbuild/backend/ninjabackend.py')
-rw-r--r--mesonbuild/backend/ninjabackend.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index f6ff722..0e6311a 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -368,6 +368,13 @@ 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, outfile):
if isinstance(target, build.CustomTarget):
self.generate_custom_target(target, outfile)
@@ -386,7 +393,7 @@ int dummy;
if isinstance(target, build.Jar):
self.generate_jar_target(target, outfile)
return
- if 'rust' in target.compilers:
+ if self.is_rust_target(target):
self.generate_rust_target(target, outfile)
return
if 'cs' in target.compilers: