diff options
| author | Sam James <sam@gentoo.org> | 2024-03-13 01:13:23 +0000 |
|---|---|---|
| committer | Eli Schwartz <eschwartz93@gmail.com> | 2024-03-28 00:52:25 -0400 |
| commit | 5bd28febf7887eebc8e55aa6e39962ae7da51281 (patch) | |
| tree | 46babf1dcb5d3e1665f50028b93ecaacc5475df1 /mesonbuild/compilers | |
| parent | 31314419aac57c45d82578700051f6ed999176af (diff) | |
| download | meson-5bd28febf7887eebc8e55aa6e39962ae7da51281.tar.gz | |
Pass Environment down from Backend
We'll need it in a moment for get_base_compile_args -> get_assert_args.
Bug: https://github.com/mesonbuild/meson/issues/12962
Signed-off-by: Sam James <sam@gentoo.org>
Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
Diffstat (limited to 'mesonbuild/compilers')
| -rw-r--r-- | mesonbuild/compilers/compilers.py | 6 | ||||
| -rw-r--r-- | mesonbuild/compilers/cpp.py | 4 | ||||
| -rw-r--r-- | mesonbuild/compilers/cuda.py | 4 | ||||
| -rw-r--r-- | mesonbuild/compilers/d.py | 6 | ||||
| -rw-r--r-- | mesonbuild/compilers/mixins/clike.py | 2 | ||||
| -rw-r--r-- | mesonbuild/compilers/rust.py | 2 |
6 files changed, 12 insertions, 12 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 5854c9e60..58941b70d 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -283,7 +283,7 @@ def are_asserts_disabled(options: KeyedOptionDictType) -> bool: options[OptionKey('buildtype')].value in {'release', 'plain'})) -def get_base_compile_args(options: 'KeyedOptionDictType', compiler: 'Compiler') -> T.List[str]: +def get_base_compile_args(options: 'KeyedOptionDictType', compiler: 'Compiler', env: 'Environment') -> T.List[str]: args: T.List[str] = [] try: if options[OptionKey('b_lto')].value: @@ -314,7 +314,7 @@ def get_base_compile_args(options: 'KeyedOptionDictType', compiler: 'Compiler') except KeyError: pass try: - args += compiler.get_assert_args(are_asserts_disabled(options)) + args += compiler.get_assert_args(are_asserts_disabled(options), env) except KeyError: pass # This does not need a try...except @@ -1060,7 +1060,7 @@ class Compiler(HoldableObject, metaclass=abc.ABCMeta): def get_coverage_link_args(self) -> T.List[str]: return self.linker.get_coverage_args() - def get_assert_args(self, disable: bool) -> T.List[str]: + def get_assert_args(self, disable: bool, env: 'Environment') -> T.List[str]: """Get arguments to enable or disable assertion. :param disable: Whether to disable assertions diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py index 2a2f7615d..c26def9fc 100644 --- a/mesonbuild/compilers/cpp.py +++ b/mesonbuild/compilers/cpp.py @@ -307,7 +307,7 @@ class ClangCPPCompiler(_StdCPPLibMixin, ClangCompiler, CPPCompiler): return libs return [] - def get_assert_args(self, disable: bool) -> T.List[str]: + def get_assert_args(self, disable: bool, env: 'Environment') -> T.List[str]: args: T.List[str] = [] if disable: return ['-DNDEBUG'] @@ -502,7 +502,7 @@ class GnuCPPCompiler(_StdCPPLibMixin, GnuCompiler, CPPCompiler): return libs return [] - def get_assert_args(self, disable: bool) -> T.List[str]: + def get_assert_args(self, disable: bool, env: 'Environment') -> T.List[str]: if disable: return ['-DNDEBUG'] diff --git a/mesonbuild/compilers/cuda.py b/mesonbuild/compilers/cuda.py index ab4810798..7f7ad7495 100644 --- a/mesonbuild/compilers/cuda.py +++ b/mesonbuild/compilers/cuda.py @@ -802,5 +802,5 @@ class CudaCompiler(Compiler): def get_profile_use_args(self) -> T.List[str]: return ['-Xcompiler=' + x for x in self.host_compiler.get_profile_use_args()] - def get_assert_args(self, disable: bool) -> T.List[str]: - return self.host_compiler.get_assert_args(disable) + def get_assert_args(self, disable: bool, env: 'Environment') -> T.List[str]: + return self.host_compiler.get_assert_args(disable, env) diff --git a/mesonbuild/compilers/d.py b/mesonbuild/compilers/d.py index 78ce2bc23..de344c057 100644 --- a/mesonbuild/compilers/d.py +++ b/mesonbuild/compilers/d.py @@ -696,7 +696,7 @@ class GnuDCompiler(GnuCompiler, DCompiler): return args return args + ['-shared-libphobos'] - def get_assert_args(self, disable: bool) -> T.List[str]: + def get_assert_args(self, disable: bool, env: 'Environment') -> T.List[str]: if disable: return ['-frelease'] return [] @@ -766,7 +766,7 @@ class LLVMDCompiler(DmdLikeCompilerMixin, DCompiler): return args return args + ['-link-defaultlib-shared'] - def get_assert_args(self, disable: bool) -> T.List[str]: + def get_assert_args(self, disable: bool, env: 'Environment') -> T.List[str]: if disable: return ['--release'] return [] @@ -852,7 +852,7 @@ class DmdDCompiler(DmdLikeCompilerMixin, DCompiler): return args return args + ['-defaultlib=phobos2', '-debuglib=phobos2'] - def get_assert_args(self, disable: bool) -> T.List[str]: + def get_assert_args(self, disable: bool, env: 'Environment') -> T.List[str]: if disable: return ['-release'] return [] diff --git a/mesonbuild/compilers/mixins/clike.py b/mesonbuild/compilers/mixins/clike.py index 09bd43881..b58b163a6 100644 --- a/mesonbuild/compilers/mixins/clike.py +++ b/mesonbuild/compilers/mixins/clike.py @@ -1309,7 +1309,7 @@ class CLikeCompiler(Compiler): return self.compiles(self.attribute_check_func(name), env, extra_args=self.get_has_func_attribute_extra_args(name)) - def get_assert_args(self, disable: bool) -> T.List[str]: + def get_assert_args(self, disable: bool, env: 'Environment') -> T.List[str]: if disable: return ['-DNDEBUG'] return [] diff --git a/mesonbuild/compilers/rust.py b/mesonbuild/compilers/rust.py index 05e8b2b27..0dc65bf33 100644 --- a/mesonbuild/compilers/rust.py +++ b/mesonbuild/compilers/rust.py @@ -215,7 +215,7 @@ class RustCompiler(Compiler): # pic is on by rustc return [] - def get_assert_args(self, disable: bool) -> T.List[str]: + def get_assert_args(self, disable: bool, env: 'Environment') -> T.List[str]: action = "no" if disable else "yes" return ['-C', f'debug-assertions={action}', '-C', 'overflow-checks=no'] |
