aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2020-10-13 09:22:59 -0700
committerNirbheek Chauhan <nirbheek@centricular.com>2021-01-06 14:52:26 +0530
commit030f1287e65073c3d521322abd874b1a902d7538 (patch)
tree37ca7d727547b67fa827cc3a1d6b22fa1ed7c40b
parentad381e272a5e330b5d79a9b07c576e40dfee6a6f (diff)
downloadmeson-030f1287e65073c3d521322abd874b1a902d7538.zip
meson-030f1287e65073c3d521322abd874b1a902d7538.tar.gz
meson-030f1287e65073c3d521322abd874b1a902d7538.tar.bz2
ninjabackend: Fix a couple of rust bugs
There are two bugs here, first is that we open coded the output args, instead of using the compiler method. The second is that rust args are not passed down to the backend invocation.
-rw-r--r--mesonbuild/backend/ninjabackend.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index 2ffbb85..2370b55 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -1489,7 +1489,7 @@ int dummy;
self.create_target_source_introspection(target, valac, args, all_files, [])
return other_src[0], other_src[1], vala_c_src
- def generate_rust_target(self, target):
+ def generate_rust_target(self, target: build.BuildTarget) -> None:
rustc = target.compilers['rust']
# Rust compiler takes only the main file as input and
# figures out what other files are needed via import
@@ -1533,7 +1533,8 @@ int dummy;
depfile = os.path.join(target.subdir, target.name + '.d')
args += ['--emit', 'dep-info={}'.format(depfile), '--emit', 'link']
args += target.get_extra_args('rust')
- args += ['-o', os.path.join(target.subdir, target.get_filename())]
+ args += rustc.get_output_args(os.path.join(target.subdir, target.get_filename()))
+ args += self.environment.coredata.get_external_args(target.for_machine, rustc.language)
orderdeps = [os.path.join(t.subdir, t.get_filename()) for t in target.link_targets]
linkdirs = OrderedDict()
for d in target.link_targets: