summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/compilers/compilers.py4
-rw-r--r--mesonbuild/compilers/cpp.py8
-rw-r--r--mesonbuild/compilers/cuda.py4
-rw-r--r--mesonbuild/compilers/d.py6
-rw-r--r--mesonbuild/compilers/mixins/clike.py2
-rw-r--r--mesonbuild/compilers/rust.py2
6 files changed, 13 insertions, 13 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index 3ef45de8f..8def474c9 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -318,7 +318,7 @@ def get_base_compile_args(target: 'BuildTarget', compiler: 'Compiler', env: 'Env
except (KeyError, AttributeError):
pass
try:
- args += compiler.get_assert_args(are_asserts_disabled(target, env), env)
+ args += compiler.get_assert_args(are_asserts_disabled(target, env))
except KeyError:
pass
# This does not need a try...except
@@ -1103,7 +1103,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, env: 'Environment') -> T.List[str]:
+ def get_assert_args(self, disable: bool) -> 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 eef39a75d..5f97c566a 100644
--- a/mesonbuild/compilers/cpp.py
+++ b/mesonbuild/compilers/cpp.py
@@ -309,7 +309,7 @@ class ClangCPPCompiler(_StdCPPLibMixin, ClangCPPStds, ClangCompiler, CPPCompiler
return libs
return []
- def get_assert_args(self, disable: bool, env: 'Environment') -> T.List[str]:
+ def get_assert_args(self, disable: bool) -> T.List[str]:
if disable:
return ['-DNDEBUG']
@@ -318,7 +318,7 @@ class ClangCPPCompiler(_StdCPPLibMixin, ClangCPPStds, ClangCompiler, CPPCompiler
if self.defines.get(macro) is not None:
return []
- if self.language_stdlib_provider(env) == 'stdc++':
+ if self.language_stdlib_provider(self.environment) == 'stdc++':
return ['-D_GLIBCXX_ASSERTIONS=1']
return ['-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST']
@@ -511,7 +511,7 @@ class GnuCPPCompiler(_StdCPPLibMixin, GnuCPPStds, GnuCompiler, CPPCompiler):
return libs
return []
- def get_assert_args(self, disable: bool, env: 'Environment') -> T.List[str]:
+ def get_assert_args(self, disable: bool) -> T.List[str]:
if disable:
return ['-DNDEBUG']
@@ -522,7 +522,7 @@ class GnuCPPCompiler(_StdCPPLibMixin, GnuCPPStds, GnuCompiler, CPPCompiler):
# For GCC, we can assume that the libstdc++ version is the same as
# the compiler itself. Anything else isn't supported.
- if self.language_stdlib_provider(env) == 'stdc++':
+ if self.language_stdlib_provider(self.environment) == 'stdc++':
return ['-D_GLIBCXX_ASSERTIONS=1']
else:
# One can use -stdlib=libc++ with GCC, it just (as of 2025) requires
diff --git a/mesonbuild/compilers/cuda.py b/mesonbuild/compilers/cuda.py
index 129b2ee14..606315e77 100644
--- a/mesonbuild/compilers/cuda.py
+++ b/mesonbuild/compilers/cuda.py
@@ -805,13 +805,13 @@ 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, env: 'Environment') -> T.List[str]:
+ def get_assert_args(self, disable: bool) -> T.List[str]:
cccl_macros = []
if not disable and self.debug_macros_available:
# https://github.com/NVIDIA/cccl/pull/2382
cccl_macros = ['-DCCCL_ENABLE_ASSERTIONS=1']
- return self.host_compiler.get_assert_args(disable, env) + cccl_macros
+ return self.host_compiler.get_assert_args(disable) + cccl_macros
def has_multi_arguments(self, args: T.List[str], env: Environment) -> T.Tuple[bool, bool]:
args = self._to_host_flags(args)
diff --git a/mesonbuild/compilers/d.py b/mesonbuild/compilers/d.py
index cfb1120a5..1fa2cbd01 100644
--- a/mesonbuild/compilers/d.py
+++ b/mesonbuild/compilers/d.py
@@ -695,7 +695,7 @@ class GnuDCompiler(GnuCompiler, DCompiler):
return args
return args + ['-shared-libphobos']
- def get_assert_args(self, disable: bool, env: 'Environment') -> T.List[str]:
+ def get_assert_args(self, disable: bool) -> T.List[str]:
if disable:
return ['-frelease']
return []
@@ -764,7 +764,7 @@ class LLVMDCompiler(DmdLikeCompilerMixin, DCompiler):
return args
return args + ['-link-defaultlib-shared']
- def get_assert_args(self, disable: bool, env: 'Environment') -> T.List[str]:
+ def get_assert_args(self, disable: bool) -> T.List[str]:
if disable:
return ['--release']
return []
@@ -848,7 +848,7 @@ class DmdDCompiler(DmdLikeCompilerMixin, DCompiler):
return args
return args + ['-defaultlib=phobos2', '-debuglib=phobos2']
- def get_assert_args(self, disable: bool, env: 'Environment') -> T.List[str]:
+ def get_assert_args(self, disable: bool) -> T.List[str]:
if disable:
return ['-release']
return []
diff --git a/mesonbuild/compilers/mixins/clike.py b/mesonbuild/compilers/mixins/clike.py
index 65933a6b5..509b87252 100644
--- a/mesonbuild/compilers/mixins/clike.py
+++ b/mesonbuild/compilers/mixins/clike.py
@@ -1364,7 +1364,7 @@ class CLikeCompiler(Compiler):
return self.compiles(self.attribute_check_func(name),
extra_args=self.get_has_func_attribute_extra_args(name))
- def get_assert_args(self, disable: bool, env: 'Environment') -> T.List[str]:
+ def get_assert_args(self, disable: bool) -> T.List[str]:
if disable:
return ['-DNDEBUG']
return []
diff --git a/mesonbuild/compilers/rust.py b/mesonbuild/compilers/rust.py
index f7e392a57..0f83bb737 100644
--- a/mesonbuild/compilers/rust.py
+++ b/mesonbuild/compilers/rust.py
@@ -423,7 +423,7 @@ class RustCompiler(Compiler):
# pic is on by rustc
return []
- def get_assert_args(self, disable: bool, env: 'Environment') -> T.List[str]:
+ def get_assert_args(self, disable: bool) -> T.List[str]:
action = "no" if disable else "yes"
return ['-C', f'debug-assertions={action}', '-C', 'overflow-checks=no']