diff options
| author | Kacper Michajłow <kasper93@gmail.com> | 2024-05-13 15:38:50 +0200 |
|---|---|---|
| committer | Eli Schwartz <eschwartz93@gmail.com> | 2024-08-07 10:33:08 -0400 |
| commit | 3702b4bdb3645a2e7ef5a067ed21ad6accf0bc93 (patch) | |
| tree | 353c39899d93552e73588c6007fcf823e05743e6 /mesonbuild/compilers | |
| parent | a5211a15207a2e6e30e213c5530a5d1bf5c2531c (diff) | |
| download | meson-3702b4bdb3645a2e7ef5a067ed21ad6accf0bc93.tar.gz | |
compilers: change get_argument_syntax to static method
This allows to get this fixed value before the class is initialized.
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Diffstat (limited to 'mesonbuild/compilers')
| -rw-r--r-- | mesonbuild/compilers/asm.py | 3 | ||||
| -rw-r--r-- | mesonbuild/compilers/compilers.py | 3 | ||||
| -rw-r--r-- | mesonbuild/compilers/mixins/gnu.py | 3 | ||||
| -rw-r--r-- | mesonbuild/compilers/mixins/visualstudio.py | 3 |
4 files changed, 8 insertions, 4 deletions
diff --git a/mesonbuild/compilers/asm.py b/mesonbuild/compilers/asm.py index cefda765f..8cd5e28dc 100644 --- a/mesonbuild/compilers/asm.py +++ b/mesonbuild/compilers/asm.py @@ -158,7 +158,8 @@ class MasmCompiler(Compiler): def get_compile_only_args(self) -> T.List[str]: return ['/c'] - def get_argument_syntax(self) -> str: + @staticmethod + def get_argument_syntax() -> str: return 'msvc' def needs_static_linker(self) -> bool: diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 3dcf496d4..b9605ccae 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -963,7 +963,8 @@ class Compiler(HoldableObject, metaclass=abc.ABCMeta): def get_pie_link_args(self) -> T.List[str]: return self.linker.get_pie_args() - def get_argument_syntax(self) -> str: + @staticmethod + def get_argument_syntax() -> str: """Returns the argument family type. Compilers fall into families if they try to emulate the command line diff --git a/mesonbuild/compilers/mixins/gnu.py b/mesonbuild/compilers/mixins/gnu.py index 7b72496ef..62f55543a 100644 --- a/mesonbuild/compilers/mixins/gnu.py +++ b/mesonbuild/compilers/mixins/gnu.py @@ -420,7 +420,8 @@ class GnuLikeCompiler(Compiler, metaclass=abc.ABCMeta): # For other targets, discard the .def file. return [] - def get_argument_syntax(self) -> str: + @staticmethod + def get_argument_syntax() -> str: return 'gcc' def get_profile_generate_args(self) -> T.List[str]: diff --git a/mesonbuild/compilers/mixins/visualstudio.py b/mesonbuild/compilers/mixins/visualstudio.py index 4ec22a0f2..f095b95e2 100644 --- a/mesonbuild/compilers/mixins/visualstudio.py +++ b/mesonbuild/compilers/mixins/visualstudio.py @@ -362,7 +362,8 @@ class VisualStudioLikeCompiler(Compiler, metaclass=abc.ABCMeta): # false without compiling anything return name in {'dllimport', 'dllexport'}, False - def get_argument_syntax(self) -> str: + @staticmethod + def get_argument_syntax() -> str: return 'msvc' def symbols_have_underscore_prefix(self, env: 'Environment') -> bool: |
