summaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2025-11-08 16:48:27 +0100
committerDylan Baker <dylan@pnwbakers.com>2025-11-12 14:56:22 -0800
commit351eda4dbb2eb630d20e63ed58452df559817b3c (patch)
tree630a8f521af529727723c66c2386f51d88a4332c /mesonbuild
parent17d1cc60ed8246b8e7f0786421bf1cdf5cb19254 (diff)
downloadmeson-351eda4dbb2eb630d20e63ed58452df559817b3c.tar.gz
rust: add get_lto_compile_args
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/compilers/rust.py5
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