aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/ninjabackend.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2020-10-13 09:22:59 -0700
committerDylan Baker <dylan@pnwbakers.com>2020-11-13 08:55:30 -0800
commit505f824cf177752c01b6193ec83f12e51035e844 (patch)
treeb3cb8959f66d055dc14eedb255eabb803dc7fe9e /mesonbuild/backend/ninjabackend.py
parent8640dbabc4afd45f4aa04cf9f42499443c0e603f (diff)
downloadmeson-505f824cf177752c01b6193ec83f12e51035e844.zip
meson-505f824cf177752c01b6193ec83f12e51035e844.tar.gz
meson-505f824cf177752c01b6193ec83f12e51035e844.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.
Diffstat (limited to 'mesonbuild/backend/ninjabackend.py')
-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 1ed742b..c3c5705 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
@@ -1539,7 +1539,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: