diff options
| -rw-r--r-- | mesonbuild/compilers/compilers.py | 2 | ||||
| -rw-r--r-- | mesonbuild/compilers/mixins/clike.py | 5 | ||||
| -rw-r--r-- | mesonbuild/compilers/mixins/visualstudio.py | 2 | ||||
| -rw-r--r-- | mesonbuild/interpreter/compiler.py | 2 |
4 files changed, 5 insertions, 6 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index f9de3e54a..9795668fc 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -988,7 +988,7 @@ class Compiler(HoldableObject, metaclass=abc.ABCMeta): # or does not target Windows return self.linker.get_win_subsystem_args(value) - def has_func_attribute(self, name: str, env: 'Environment') -> T.Tuple[bool, bool]: + def has_func_attribute(self, name: str) -> T.Tuple[bool, bool]: raise EnvironmentException( f'Language {self.get_display_language()} does not support function attributes.') diff --git a/mesonbuild/compilers/mixins/clike.py b/mesonbuild/compilers/mixins/clike.py index 509b87252..2f6ca6eab 100644 --- a/mesonbuild/compilers/mixins/clike.py +++ b/mesonbuild/compilers/mixins/clike.py @@ -1353,11 +1353,10 @@ class CLikeCompiler(Compiler): # mixins. return ['-Werror'] - def has_func_attribute(self, name: str, env: 'Environment') -> T.Tuple[bool, bool]: + def has_func_attribute(self, name: str) -> T.Tuple[bool, bool]: # Just assume that if we're not on windows that dllimport and dllexport # don't work - m = env.machines[self.for_machine] - if not (m.is_windows() or m.is_cygwin()): + if not (self.info.is_windows() or self.info.is_cygwin()): if name in {'dllimport', 'dllexport'}: return False, False diff --git a/mesonbuild/compilers/mixins/visualstudio.py b/mesonbuild/compilers/mixins/visualstudio.py index 1a00721b6..02727fb7a 100644 --- a/mesonbuild/compilers/mixins/visualstudio.py +++ b/mesonbuild/compilers/mixins/visualstudio.py @@ -358,7 +358,7 @@ class VisualStudioLikeCompiler(Compiler, metaclass=abc.ABCMeta): crt_val = self.get_crt_val(crt_val, buildtype) return self.crt_args[crt_val] - def has_func_attribute(self, name: str, env: 'Environment') -> T.Tuple[bool, bool]: + def has_func_attribute(self, name: str) -> T.Tuple[bool, bool]: # MSVC doesn't have __attribute__ like Clang and GCC do, so just return # false without compiling anything return name in {'dllimport', 'dllexport'}, False diff --git a/mesonbuild/interpreter/compiler.py b/mesonbuild/interpreter/compiler.py index 30c7eff69..767dd597d 100644 --- a/mesonbuild/interpreter/compiler.py +++ b/mesonbuild/interpreter/compiler.py @@ -847,7 +847,7 @@ class CompilerHolder(ObjectHolder['Compiler']): logargs += ['skipped: feature', mlog.bold(feature), 'disabled'] mlog.log(*logargs) return False - had, cached = self.compiler.has_func_attribute(attr, self.environment) + had, cached = self.compiler.has_func_attribute(attr) if required and not had: logargs += ['not usable'] raise InterpreterException(*logargs) |
