diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2024-04-14 12:58:30 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2025-02-13 15:26:44 +0200 |
commit | 518c732ea9b0f1975f6f28accff3286be4106538 (patch) | |
tree | 2be9544828545a2f9f0676efc6eb82ac197ec4bd /mesonbuild/compilers/rust.py | |
parent | ea678ed82938ceac00682b2695b57193d36b71b4 (diff) | |
download | meson-optionrefactor3.zip meson-optionrefactor3.tar.gz meson-optionrefactor3.tar.bz2 |
Make all Meson level options overridable per subproject.optionrefactor3
Diffstat (limited to 'mesonbuild/compilers/rust.py')
-rw-r--r-- | mesonbuild/compilers/rust.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/mesonbuild/compilers/rust.py b/mesonbuild/compilers/rust.py index aacdc07..3acc30e 100644 --- a/mesonbuild/compilers/rust.py +++ b/mesonbuild/compilers/rust.py @@ -15,12 +15,13 @@ from ..options import OptionKey from .compilers import Compiler, clike_debug_args if T.TYPE_CHECKING: - from ..coredata import MutableKeyedOptionDictType, KeyedOptionDictType + from ..coredata import MutableKeyedOptionDictType from ..envconfig import MachineInfo from ..environment import Environment # noqa: F401 from ..linkers.linkers import DynamicLinker from ..mesonlib import MachineChoice from ..dependencies import Dependency + from ..build import BuildTarget rust_optimization_args: T.Dict[str, T.List[str]] = { @@ -251,10 +252,10 @@ class RustCompiler(Compiler): # provided by the linker flags. return [] - def get_option_compile_args(self, options: 'KeyedOptionDictType') -> T.List[str]: + def get_option_compile_args(self, target: 'BuildTarget', env: 'Environment', subproject: T.Optional[str] = None) -> T.List[str]: args = [] - key = self.form_compileropt_key('std') - std = options.get_value(key) + std = self.get_compileropt_value('std', env, target, subproject) + assert isinstance(std, str) if std != 'none': args.append('--edition=' + std) return args |