diff options
| author | Dylan Baker <dylan@pnwbakers.com> | 2025-10-31 10:58:43 -0700 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2025-11-19 10:48:48 -0800 |
| commit | e6a8aea750a0eafe26e5470fa5c33eb1e61b768b (patch) | |
| tree | fc0c0a0a32802958f84de5289e8ac78c73816db0 | |
| parent | 377fde5cf1ad8aa31c8731efabad13c1b49dbee2 (diff) | |
| download | meson-e6a8aea750a0eafe26e5470fa5c33eb1e61b768b.tar.gz | |
compilers: Remove Environment parameter from get_compileropt_value
| -rw-r--r-- | mesonbuild/compilers/c.py | 32 | ||||
| -rw-r--r-- | mesonbuild/compilers/compilers.py | 5 | ||||
| -rw-r--r-- | mesonbuild/compilers/cpp.py | 56 | ||||
| -rw-r--r-- | mesonbuild/compilers/cuda.py | 2 | ||||
| -rw-r--r-- | mesonbuild/compilers/cython.py | 4 | ||||
| -rw-r--r-- | mesonbuild/compilers/fortran.py | 6 | ||||
| -rw-r--r-- | mesonbuild/compilers/objc.py | 2 | ||||
| -rw-r--r-- | mesonbuild/compilers/objcpp.py | 2 | ||||
| -rw-r--r-- | mesonbuild/compilers/rust.py | 4 | ||||
| -rw-r--r-- | mesonbuild/compilers/swift.py | 2 |
10 files changed, 57 insertions, 58 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py index 8dc17e0b1..e6b1ca139 100644 --- a/mesonbuild/compilers/c.py +++ b/mesonbuild/compilers/c.py @@ -131,7 +131,7 @@ class ClangCCompiler(ClangCStds, ClangCompiler, CCompiler): def get_option_std_args(self, target: BuildTarget, env: Environment, subproject: T.Optional[str] = None) -> T.List[str]: args = [] - std = self.get_compileropt_value('std', env, target, subproject) + std = self.get_compileropt_value('std', target, subproject) assert isinstance(std, str) if std != 'none': args.append('-std=' + std) @@ -139,7 +139,7 @@ class ClangCCompiler(ClangCStds, ClangCompiler, CCompiler): def get_option_link_args(self, target: 'BuildTarget', env: 'Environment', subproject: T.Optional[str] = None) -> T.List[str]: if self.info.is_windows() or self.info.is_cygwin(): - retval = self.get_compileropt_value('winlibs', env, target, subproject) + retval = self.get_compileropt_value('winlibs', target, subproject) assert isinstance(retval, list) libs: T.List[str] = retval.copy() for l in libs: @@ -216,7 +216,7 @@ class ArmclangCCompiler(ArmclangCompiler, CCompiler): def get_option_std_args(self, target: BuildTarget, env: Environment, subproject: T.Optional[str] = None) -> T.List[str]: args = [] - std = self.get_compileropt_value('std', env, target, subproject) + std = self.get_compileropt_value('std', target, subproject) assert isinstance(std, str) if std != 'none': args.append('-std=' + std) @@ -260,7 +260,7 @@ class GnuCCompiler(GnuCStds, GnuCompiler, CCompiler): def get_option_std_args(self, target: BuildTarget, env: Environment, subproject: T.Optional[str] = None) -> T.List[str]: args = [] key = OptionKey('c_std', machine=self.for_machine) - std = self.get_compileropt_value(key, env, target, subproject) + std = self.get_compileropt_value(key, target, subproject) assert isinstance(std, str) if std != 'none': args.append('-std=' + std) @@ -269,7 +269,7 @@ class GnuCCompiler(GnuCStds, GnuCompiler, CCompiler): def get_option_link_args(self, target: 'BuildTarget', env: 'Environment', subproject: T.Optional[str] = None) -> T.List[str]: if self.info.is_windows() or self.info.is_cygwin(): # without a typeddict mypy can't figure this out - retval = self.get_compileropt_value('winlibs', env, target, subproject) + retval = self.get_compileropt_value('winlibs', target, subproject) assert isinstance(retval, list) libs: T.List[str] = retval.copy() @@ -379,7 +379,7 @@ class IntelCCompiler(IntelGnuLikeCompiler, CCompiler): def get_option_std_args(self, target: BuildTarget, env: Environment, subproject: T.Optional[str] = None) -> T.List[str]: args: T.List[str] = [] - std = self.get_compileropt_value('std', env, target, subproject) + std = self.get_compileropt_value('std', target, subproject) assert isinstance(std, str) if std != 'none': args.append('-std=' + std) @@ -405,7 +405,7 @@ class VisualStudioLikeCCompilerMixin(CompilerMixinBase): return opts def get_option_link_args(self, target: 'BuildTarget', env: 'Environment', subproject: T.Optional[str] = None) -> T.List[str]: - retval = self.get_compileropt_value('winlibs', env, target, subproject) + retval = self.get_compileropt_value('winlibs', target, subproject) assert isinstance(retval, list) libs: T.List[str] = retval.copy() for l in libs: @@ -441,7 +441,7 @@ class VisualStudioCCompiler(MSVCCompiler, VisualStudioLikeCCompilerMixin, CCompi def get_option_std_args(self, target: BuildTarget, env: Environment, subproject: T.Optional[str] = None) -> T.List[str]: args = [] - std = self.get_compileropt_value('std', env, target, subproject) + std = self.get_compileropt_value('std', target, subproject) # As of MVSC 16.8, /std:c11 and /std:c17 are the only valid C standard options. if std in {'c11'}: @@ -461,7 +461,7 @@ class ClangClCCompiler(ClangCStds, ClangClCompiler, VisualStudioLikeCCompilerMix ClangClCompiler.__init__(self, target) def get_option_std_args(self, target: BuildTarget, env: Environment, subproject: T.Optional[str] = None) -> T.List[str]: - std = self.get_compileropt_value('std', env, target, subproject) + std = self.get_compileropt_value('std', target, subproject) assert isinstance(std, str) if std != "none": return [f'/clang:-std={std}'] @@ -490,7 +490,7 @@ class IntelClCCompiler(IntelVisualStudioLikeCompiler, VisualStudioLikeCCompilerM def get_option_std_args(self, target: BuildTarget, env: Environment, subproject: T.Optional[str] = None) -> T.List[str]: args: T.List[str] = [] - std = self.get_compileropt_value('std', env, target, subproject) + std = self.get_compileropt_value('std', target, subproject) assert isinstance(std, str) if std == 'c89': mlog.log("ICL doesn't explicitly implement c89, setting the standard to 'none', which is close.", once=True) @@ -523,7 +523,7 @@ class ArmCCompiler(ArmCompiler, CCompiler): def get_option_std_args(self, target: BuildTarget, env: Environment, subproject: T.Optional[str] = None) -> T.List[str]: args = [] - std = self.get_compileropt_value('std', env, target, subproject) + std = self.get_compileropt_value('std', target, subproject) assert isinstance(std, str) if std != 'none': args.append('--' + std) @@ -556,7 +556,7 @@ class CcrxCCompiler(CcrxCompiler, CCompiler): def get_option_std_args(self, target: BuildTarget, env: Environment, subproject: T.Optional[str] = None) -> T.List[str]: args = [] - std = self.get_compileropt_value('std', env, target, subproject) + std = self.get_compileropt_value('std', target, subproject) assert isinstance(std, str) if std == 'c89': args.append('-lang=c') @@ -604,7 +604,7 @@ class Xc16CCompiler(Xc16Compiler, CCompiler): def get_option_std_args(self, target: BuildTarget, env: Environment, subproject: T.Optional[str] = None) -> T.List[str]: args = [] - std = self.get_compileropt_value('std', env, target, subproject) + std = self.get_compileropt_value('std', target, subproject) assert isinstance(std, str) if std != 'none': args.append('-ansi') @@ -699,7 +699,7 @@ class TICCompiler(TICompiler, CCompiler): def get_option_std_args(self, target: BuildTarget, env: Environment, subproject: T.Optional[str] = None) -> T.List[str]: args = [] - std = self.get_compileropt_value('std', env, target, subproject) + std = self.get_compileropt_value('std', target, subproject) assert isinstance(std, str) if std != 'none': args.append('--' + std) @@ -733,7 +733,7 @@ class MetrowerksCCompilerARM(MetrowerksCompiler, CCompiler): def get_option_std_args(self, target: BuildTarget, env: Environment, subproject: T.Optional[str] = None) -> T.List[str]: args = [] - std = self.get_compileropt_value('std', env, target, subproject) + std = self.get_compileropt_value('std', target, subproject) assert isinstance(std, str) if std != 'none': args.append('-lang') @@ -761,7 +761,7 @@ class MetrowerksCCompilerEmbeddedPowerPC(MetrowerksCompiler, CCompiler): def get_option_std_args(self, target: BuildTarget, env: Environment, subproject: T.Optional[str] = None) -> T.List[str]: args = [] - std = self.get_compileropt_value('std', env, target, subproject) + std = self.get_compileropt_value('std', target, subproject) assert isinstance(std, str) if std != 'none': args.append('-lang ' + std) diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 2d548a45d..b5680ed56 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -1422,16 +1422,15 @@ class Compiler(HoldableObject, metaclass=abc.ABCMeta): def get_compileropt_value(self, key: T.Union[str, OptionKey], - env: Environment, target: T.Optional[BuildTarget], subproject: T.Optional[str] = None ) -> options.ElementaryOptionValues: if isinstance(key, str): key = self.form_compileropt_key(key) if target: - return env.coredata.get_option_for_target(target, key) + return self.environment.coredata.get_option_for_target(target, key) else: - return env.coredata.optstore.get_value_for(key.evolve(subproject=subproject)) + return self.environment.coredata.optstore.get_value_for(key.evolve(subproject=subproject)) def _update_language_stds(self, opts: MutableKeyedOptionDictType, value: T.List[str]) -> None: key = self.form_compileropt_key('std') diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py index f53004f61..b1830a1c2 100644 --- a/mesonbuild/compilers/cpp.py +++ b/mesonbuild/compilers/cpp.py @@ -265,9 +265,9 @@ class ClangCPPCompiler(_StdCPPLibMixin, ClangCPPStds, ClangCompiler, CPPCompiler def get_option_compile_args(self, target: 'BuildTarget', env: 'Environment', subproject: T.Optional[str] = None) -> T.List[str]: args: T.List[str] = [] - rtti = self.get_compileropt_value('rtti', env, target, subproject) - debugstl = self.get_compileropt_value('debugstl', env, target, subproject) - eh = self.get_compileropt_value('eh', env, target, subproject) + rtti = self.get_compileropt_value('rtti', target, subproject) + debugstl = self.get_compileropt_value('debugstl', target, subproject) + eh = self.get_compileropt_value('eh', target, subproject) assert isinstance(rtti, bool) assert isinstance(eh, str) @@ -292,7 +292,7 @@ class ClangCPPCompiler(_StdCPPLibMixin, ClangCPPStds, ClangCompiler, CPPCompiler def get_option_std_args(self, target: BuildTarget, env: Environment, subproject: T.Optional[str] = None) -> T.List[str]: args: T.List[str] = [] - std = self.get_compileropt_value('std', env, target, subproject) + std = self.get_compileropt_value('std', target, subproject) assert isinstance(std, str) if std != 'none': args.append(self._find_best_cpp_std(std)) @@ -301,7 +301,7 @@ class ClangCPPCompiler(_StdCPPLibMixin, ClangCPPStds, ClangCompiler, CPPCompiler def get_option_link_args(self, target: 'BuildTarget', env: 'Environment', subproject: T.Optional[str] = None) -> T.List[str]: if self.info.is_windows() or self.info.is_cygwin(): # without a typedict mypy can't understand this. - retval = self.get_compileropt_value('winlibs', env, target, subproject) + retval = self.get_compileropt_value('winlibs', target, subproject) assert isinstance(retval, list) libs = retval[:] for l in libs: @@ -365,7 +365,7 @@ class EmscriptenCPPCompiler(EmscriptenMixin, ClangCPPCompiler): def get_option_std_args(self, target: BuildTarget, env: Environment, subproject: T.Optional[str] = None) -> T.List[str]: args: T.List[str] = [] - std = self.get_compileropt_value('std', env, target, subproject) + std = self.get_compileropt_value('std', target, subproject) assert isinstance(std, str) if std != 'none': args.append(self._find_best_cpp_std(std)) @@ -408,12 +408,12 @@ class ArmclangCPPCompiler(ArmclangCompiler, CPPCompiler): def get_option_std_args(self, target: BuildTarget, env: Environment, subproject: T.Optional[str] = None) -> T.List[str]: args: T.List[str] = [] - std = self.get_compileropt_value('std', env, target, subproject) + std = self.get_compileropt_value('std', target, subproject) assert isinstance(std, str) if std != 'none': args.append('-std=' + std) - eh = self.get_compileropt_value('eh', env, target, subproject) + eh = self.get_compileropt_value('eh', target, subproject) assert isinstance(eh, str) non_msvc_eh_options(eh, args) @@ -474,9 +474,9 @@ class GnuCPPCompiler(_StdCPPLibMixin, GnuCPPStds, GnuCompiler, CPPCompiler): def get_option_compile_args(self, target: 'BuildTarget', env: 'Environment', subproject: T.Optional[str] = None) -> T.List[str]: args: T.List[str] = [] - rtti = self.get_compileropt_value('rtti', env, target, subproject) - debugstl = self.get_compileropt_value('debugstl', env, target, subproject) - eh = self.get_compileropt_value('eh', env, target, subproject) + rtti = self.get_compileropt_value('rtti', target, subproject) + debugstl = self.get_compileropt_value('debugstl', target, subproject) + eh = self.get_compileropt_value('eh', target, subproject) assert isinstance(rtti, bool) assert isinstance(eh, str) @@ -494,7 +494,7 @@ class GnuCPPCompiler(_StdCPPLibMixin, GnuCPPStds, GnuCompiler, CPPCompiler): def get_option_std_args(self, target: BuildTarget, env: Environment, subproject: T.Optional[str] = None) -> T.List[str]: args: T.List[str] = [] - std = self.get_compileropt_value('std', env, target, subproject) + std = self.get_compileropt_value('std', target, subproject) assert isinstance(std, str) if std != 'none': args.append(self._find_best_cpp_std(std)) @@ -503,7 +503,7 @@ class GnuCPPCompiler(_StdCPPLibMixin, GnuCPPStds, GnuCompiler, CPPCompiler): def get_option_link_args(self, target: 'BuildTarget', env: 'Environment', subproject: T.Optional[str] = None) -> T.List[str]: if self.info.is_windows() or self.info.is_cygwin(): # without a typedict mypy can't understand this. - retval = self.get_compileropt_value('winlibs', env, target, subproject) + retval = self.get_compileropt_value('winlibs', target, subproject) assert isinstance(retval, list) libs: T.List[str] = retval[:] for l in libs: @@ -632,12 +632,12 @@ class ElbrusCPPCompiler(ElbrusCompiler, CPPCompiler): # Elbrus C++ compiler does not support RTTI, so don't check for it. def get_option_compile_args(self, target: 'BuildTarget', env: 'Environment', subproject: T.Optional[str] = None) -> T.List[str]: args: T.List[str] = [] - eh = self.get_compileropt_value('eh', env, target, subproject) + eh = self.get_compileropt_value('eh', target, subproject) assert isinstance(eh, str) non_msvc_eh_options(eh, args) - debugstl = self.get_compileropt_value('debugstl', env, target, subproject) + debugstl = self.get_compileropt_value('debugstl', target, subproject) assert isinstance(debugstl, str) if debugstl: args.append('-D_GLIBCXX_DEBUG=1') @@ -645,7 +645,7 @@ class ElbrusCPPCompiler(ElbrusCompiler, CPPCompiler): def get_option_std_args(self, target: BuildTarget, env: Environment, subproject: T.Optional[str] = None) -> T.List[str]: args: T.List[str] = [] - std = self.get_compileropt_value('std', env, target, subproject) + std = self.get_compileropt_value('std', target, subproject) assert isinstance(std, str) if std != 'none': args.append(self._find_best_cpp_std(std)) @@ -711,9 +711,9 @@ class IntelCPPCompiler(IntelGnuLikeCompiler, CPPCompiler): def get_option_compile_args(self, target: 'BuildTarget', env: 'Environment', subproject: T.Optional[str] = None) -> T.List[str]: args: T.List[str] = [] - rtti = self.get_compileropt_value('rtti', env, target, subproject) - debugstl = self.get_compileropt_value('debugstl', env, target, subproject) - eh = self.get_compileropt_value('eh', env, target, subproject) + rtti = self.get_compileropt_value('rtti', target, subproject) + debugstl = self.get_compileropt_value('debugstl', target, subproject) + eh = self.get_compileropt_value('eh', target, subproject) assert isinstance(rtti, bool) assert isinstance(eh, str) @@ -729,7 +729,7 @@ class IntelCPPCompiler(IntelGnuLikeCompiler, CPPCompiler): def get_option_std_args(self, target: BuildTarget, env: Environment, subproject: T.Optional[str] = None) -> T.List[str]: args: T.List[str] = [] - std = self.get_compileropt_value('std', env, target, subproject) + std = self.get_compileropt_value('std', target, subproject) assert isinstance(std, str) if std != 'none': remap_cpp03 = { @@ -806,8 +806,8 @@ class VisualStudioLikeCPPCompilerMixin(CompilerMixinBase): def get_option_compile_args(self, target: 'BuildTarget', env: 'Environment', subproject: T.Optional[str] = None) -> T.List[str]: args: T.List[str] = [] - eh = self.get_compileropt_value('eh', env, target, subproject) - rtti = self.get_compileropt_value('rtti', env, target, subproject) + eh = self.get_compileropt_value('eh', target, subproject) + rtti = self.get_compileropt_value('rtti', target, subproject) assert isinstance(rtti, bool) assert isinstance(eh, str) @@ -826,7 +826,7 @@ class VisualStudioLikeCPPCompilerMixin(CompilerMixinBase): def get_option_std_args(self, target: BuildTarget, env: Environment, subproject: T.Optional[str] = None) -> T.List[str]: args: T.List[str] = [] - std = self.get_compileropt_value('std', env, target, subproject) + std = self.get_compileropt_value('std', target, subproject) assert isinstance(std, str) permissive, ver = self.VC_VERSION_MAP[std] @@ -898,7 +898,7 @@ class VisualStudioCPPCompiler(CPP11AsCPP14Mixin, VisualStudioLikeCPPCompilerMixi return self._get_options_impl(super().get_options(), cpp_stds) def get_option_std_args(self, target: BuildTarget, env: Environment, subproject: T.Optional[str] = None) -> T.List[str]: - std = self.get_compileropt_value('std', env, target, subproject) + std = self.get_compileropt_value('std', target, subproject) if std != 'none' and version_compare(self.version, '<19.00.24210'): mlog.warning('This version of MSVC does not support cpp_std arguments', fatal=False) @@ -976,7 +976,7 @@ class ArmCPPCompiler(ArmCompiler, CPPCompiler): def get_option_std_args(self, target: BuildTarget, env: Environment, subproject: T.Optional[str] = None) -> T.List[str]: args: T.List[str] = [] - std = self.get_compileropt_value('std', env, target, subproject) + std = self.get_compileropt_value('std', target, subproject) assert isinstance(std, str) if std == 'c++11': args.append('--cpp11') @@ -1033,7 +1033,7 @@ class TICPPCompiler(TICompiler, CPPCompiler): def get_option_std_args(self, target: BuildTarget, env: Environment, subproject: T.Optional[str] = None) -> T.List[str]: args: T.List[str] = [] - std = self.get_compileropt_value('std', env, target, subproject) + std = self.get_compileropt_value('std', target, subproject) assert isinstance(std, str) if std != 'none': args.append('--' + std) @@ -1072,7 +1072,7 @@ class MetrowerksCPPCompilerARM(MetrowerksCompiler, CPPCompiler): def get_option_std_args(self, target: BuildTarget, env: Environment, subproject: T.Optional[str] = None) -> T.List[str]: args: T.List[str] = [] - std = self.get_compileropt_value('std', env, target, subproject) + std = self.get_compileropt_value('std', target, subproject) assert isinstance(std, str) if std != 'none': args.append('-lang') @@ -1099,7 +1099,7 @@ class MetrowerksCPPCompilerEmbeddedPowerPC(MetrowerksCompiler, CPPCompiler): def get_option_std_args(self, target: BuildTarget, env: Environment, subproject: T.Optional[str] = None) -> T.List[str]: args: T.List[str] = [] - std = self.get_compileropt_value('std', env, target, subproject) + std = self.get_compileropt_value('std', target, subproject) assert isinstance(std, str) if std != 'none': args.append('-lang ' + std) diff --git a/mesonbuild/compilers/cuda.py b/mesonbuild/compilers/cuda.py index b13a1fdac..9d77968f3 100644 --- a/mesonbuild/compilers/cuda.py +++ b/mesonbuild/compilers/cuda.py @@ -663,7 +663,7 @@ class CudaCompiler(Compiler): # the combination of CUDA version and MSVC version; the --std= is thus ignored # and attempting to use it will result in a warning: https://stackoverflow.com/a/51272091/741027 if not is_windows(): - std = self.get_compileropt_value('std', env, target, subproject) + std = self.get_compileropt_value('std', target, subproject) assert isinstance(std, str) if std != 'none': return ['--std=' + std] diff --git a/mesonbuild/compilers/cython.py b/mesonbuild/compilers/cython.py index 50bb4652b..2eced65f9 100644 --- a/mesonbuild/compilers/cython.py +++ b/mesonbuild/compilers/cython.py @@ -88,11 +88,11 @@ class CythonCompiler(Compiler): def get_option_compile_args(self, target: 'BuildTarget', env: 'Environment', subproject: T.Optional[str] = None) -> T.List[str]: args: T.List[str] = [] - version = self.get_compileropt_value('version', env, target, subproject) + version = self.get_compileropt_value('version', target, subproject) assert isinstance(version, str) args.append(f'-{version}') - lang = self.get_compileropt_value('language', env, target, subproject) + lang = self.get_compileropt_value('language', target, subproject) assert isinstance(lang, str) if lang == 'cpp': args.append('--cplus') diff --git a/mesonbuild/compilers/fortran.py b/mesonbuild/compilers/fortran.py index 46211465f..6ec8546a5 100644 --- a/mesonbuild/compilers/fortran.py +++ b/mesonbuild/compilers/fortran.py @@ -284,7 +284,7 @@ class GnuFortranCompiler(GnuCompiler, FortranCompiler): def get_option_std_args(self, target: BuildTarget, env: Environment, subproject: T.Optional[str] = None) -> T.List[str]: args: T.List[str] = [] - std = self.get_compileropt_value('std', env, target, subproject) + std = self.get_compileropt_value('std', target, subproject) assert isinstance(std, str) if std != 'none': args.append('-std=' + std) @@ -414,7 +414,7 @@ class IntelFortranCompiler(IntelGnuLikeCompiler, FortranCompiler): def get_option_std_args(self, target: BuildTarget, env: Environment, subproject: T.Optional[str] = None) -> T.List[str]: args: T.List[str] = [] - std = self.get_compileropt_value('std', env, target, subproject) + std = self.get_compileropt_value('std', target, subproject) stds = {'legacy': 'none', 'f95': 'f95', 'f2003': 'f03', 'f2008': 'f08', 'f2018': 'f18'} assert isinstance(std, str) if std != 'none': @@ -472,7 +472,7 @@ class IntelClFortranCompiler(IntelVisualStudioLikeCompiler, FortranCompiler): def get_option_std_args(self, target: BuildTarget, env: Environment, subproject: T.Optional[str] = None) -> T.List[str]: args: T.List[str] = [] - std = self.get_compileropt_value('std', env, target, subproject) + std = self.get_compileropt_value('std', target, subproject) stds = {'legacy': 'none', 'f95': 'f95', 'f2003': 'f03', 'f2008': 'f08', 'f2018': 'f18'} assert isinstance(std, str) if std != 'none': diff --git a/mesonbuild/compilers/objc.py b/mesonbuild/compilers/objc.py index 58d676786..9de945728 100644 --- a/mesonbuild/compilers/objc.py +++ b/mesonbuild/compilers/objc.py @@ -116,7 +116,7 @@ class ClangObjCCompiler(ClangCStds, ClangCompiler, ObjCCompiler): def get_option_std_args(self, target: BuildTarget, env: Environment, subproject: T.Optional[str] = None) -> T.List[str]: args = [] key = OptionKey('c_std', machine=self.for_machine) - std = self.get_compileropt_value(key, env, target, subproject) + std = self.get_compileropt_value(key, target, subproject) assert isinstance(std, str) if std != 'none': args.append('-std=' + std) diff --git a/mesonbuild/compilers/objcpp.py b/mesonbuild/compilers/objcpp.py index df71de3c9..6a4f45e25 100644 --- a/mesonbuild/compilers/objcpp.py +++ b/mesonbuild/compilers/objcpp.py @@ -111,7 +111,7 @@ class ClangObjCPPCompiler(ClangCPPStds, ClangCompiler, ObjCPPCompiler): def get_option_std_args(self, target: BuildTarget, env: Environment, subproject: T.Optional[str] = None) -> T.List[str]: args = [] key = OptionKey('cpp_std', machine=self.for_machine) - std = self.get_compileropt_value(key, env, target, subproject) + std = self.get_compileropt_value(key, target, subproject) assert isinstance(std, str) if std != 'none': args.append('-std=' + std) diff --git a/mesonbuild/compilers/rust.py b/mesonbuild/compilers/rust.py index a6954f866..0faf2cf96 100644 --- a/mesonbuild/compilers/rust.py +++ b/mesonbuild/compilers/rust.py @@ -154,7 +154,7 @@ class RustCompiler(Compiler): # This is done here because it's the only place we have access to # environment object, and sanity_check() is called after the compiler # options have been initialized. - nightly_opt = self.get_compileropt_value('nightly', environment, None) + nightly_opt = self.get_compileropt_value('nightly', None) if nightly_opt == 'enabled' and not self.is_nightly: raise EnvironmentException(f'Rust compiler {self.name_string()} is not a nightly compiler as required by the "nightly" option.') self.allow_nightly = nightly_opt != 'disabled' and self.is_nightly @@ -329,7 +329,7 @@ class RustCompiler(Compiler): def get_option_std_args(self, target: BuildTarget, env: Environment, subproject: T.Optional[str] = None) -> T.List[str]: args = [] - std = self.get_compileropt_value('std', env, target, subproject) + std = self.get_compileropt_value('std', target, subproject) assert isinstance(std, str) if std != 'none': args.append('--edition=' + std) diff --git a/mesonbuild/compilers/swift.py b/mesonbuild/compilers/swift.py index 2a0c6fd09..3952a5fa2 100644 --- a/mesonbuild/compilers/swift.py +++ b/mesonbuild/compilers/swift.py @@ -131,7 +131,7 @@ class SwiftCompiler(Compiler): def get_option_std_args(self, target: build.BuildTarget, env: Environment, subproject: T.Optional[str] = None) -> T.List[str]: args: T.List[str] = [] - std = self.get_compileropt_value('std', env, target, subproject) + std = self.get_compileropt_value('std', target, subproject) assert isinstance(std, str) if std != 'none': |
