diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 3c5cdf025..9ff6f74cc 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -1293,6 +1293,8 @@ int dummy; else: raise InvalidArguments('Unknown target type for rustc.') args.append(cratetype) + if cratetype in {'bin', 'dylib'}: + args += rustc.linker.get_always_args() args += ['--crate-name', target.name] args += rustc.get_buildtype_args(self.get_option_for_target('buildtype', target)) args += rustc.get_debug_args(self.get_option_for_target('debug', target))