diff options
| author | Paolo Bonzini <pbonzini@redhat.com> | 2025-02-04 17:53:44 +0100 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2025-07-18 09:42:56 -0700 |
| commit | ff963e657cf1151cf002efc123563cb40dabab11 (patch) | |
| tree | 99fde408ecc91fe6887a093e4a892f5a86cdd381 /mesonbuild/compilers/rust.py | |
| parent | 08798850c1c2798e55fe7099cbff231e48d52e42 (diff) | |
| download | meson-ff963e657cf1151cf002efc123563cb40dabab11.tar.gz | |
rust: add rust_dynamic_std option
As an initial implementation, simply adding "-C prefer-dynamic" works
for binary crates (as well as dylib and proc-macro that already used it).
In the future this could be extended to other crate types. For more
information see the comment in the changed file, as well as
https://github.com/mesonbuild/meson/issues/8828 and
https://github.com/mesonbuild/meson/issues/14215.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'mesonbuild/compilers/rust.py')
| -rw-r--r-- | mesonbuild/compilers/rust.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mesonbuild/compilers/rust.py b/mesonbuild/compilers/rust.py index 38e70556e..b72f6b08a 100644 --- a/mesonbuild/compilers/rust.py +++ b/mesonbuild/compilers/rust.py @@ -241,6 +241,12 @@ class RustCompiler(Compiler): 'none', choices=['none', '2015', '2018', '2021', '2024']) + key = self.form_compileropt_key('dynamic_std') + opts[key] = options.UserBooleanOption( + self.make_option_name(key), + 'Whether to link Rust build targets to a dynamic libstd', + False) + return opts def get_dependency_compile_args(self, dep: 'Dependency') -> T.List[str]: |
