diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2021-05-04 14:41:33 -0700 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2021-05-19 23:28:17 +0300 |
commit | b1b8e777a226a347785a162161d1c68e041dc5c9 (patch) | |
tree | a7139bf07745245a9c3acca735f7832e465882e8 /mesonbuild | |
parent | 189545c2a82621641d1c239c4066c132d2035f1a (diff) | |
download | meson-b1b8e777a226a347785a162161d1c68e041dc5c9.zip meson-b1b8e777a226a347785a162161d1c68e041dc5c9.tar.gz meson-b1b8e777a226a347785a162161d1c68e041dc5c9.tar.bz2 |
rust: override get_linker_always_args
instead of opencoding what should be there in the rust compile rule
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 3 | ||||
-rw-r--r-- | mesonbuild/compilers/rust.py | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 3749ff7..c2ce827 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -1582,8 +1582,7 @@ int dummy; # Rust is super annoying, calling -C link-arg foo does not work, it has # to be -C link-arg=foo if cratetype in {'bin', 'dylib'}: - for a in rustc.linker.get_always_args(): - args += ['-C', f'link-arg={a}'] + args.extend(rustc.get_linker_always_args()) opt_proxy = self.get_compiler_options_for_target(target) diff --git a/mesonbuild/compilers/rust.py b/mesonbuild/compilers/rust.py index 285d490..6a7bd04 100644 --- a/mesonbuild/compilers/rust.py +++ b/mesonbuild/compilers/rust.py @@ -162,3 +162,9 @@ class RustCompiler(Compiler): if colortype in {'always', 'never', 'auto'}: return [f'--color={colortype}'] raise MesonException(f'Invalid color type for rust {colortype}') + + def get_linker_always_args(self) -> T.List[str]: + args: T.List[str] = [] + for a in super().get_linker_always_args(): + args.extend(['-C', f'link-arg={a}']) + return args |