diff options
| author | Paolo Bonzini <pbonzini@redhat.com> | 2025-11-08 16:48:27 +0100 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2025-11-12 14:56:22 -0800 |
| commit | 351eda4dbb2eb630d20e63ed58452df559817b3c (patch) | |
| tree | 630a8f521af529727723c66c2386f51d88a4332c | |
| parent | 17d1cc60ed8246b8e7f0786421bf1cdf5cb19254 (diff) | |
| download | meson-351eda4dbb2eb630d20e63ed58452df559817b3c.tar.gz | |
rust: add get_lto_compile_args
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| -rw-r--r-- | mesonbuild/compilers/rust.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/mesonbuild/compilers/rust.py b/mesonbuild/compilers/rust.py index fadf9772f..54b3da91a 100644 --- a/mesonbuild/compilers/rust.py +++ b/mesonbuild/compilers/rust.py @@ -341,6 +341,11 @@ class RustCompiler(Compiler): args.extend(['-C', f'link-arg={a}']) return args + def get_lto_compile_args(self, *, threads: int = 0, mode: str = 'default') -> T.List[str]: + # TODO: what about -Clinker-plugin-lto? + rustc_lto = 'lto=thin' if mode == 'thin' else 'lto' + return ['-C', rustc_lto] + def get_werror_args(self) -> T.List[str]: # Use -D warnings, which makes every warning not explicitly allowed an # error |
