aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/mixins
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/compilers/mixins')
-rw-r--r--mesonbuild/compilers/mixins/visualstudio.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/mesonbuild/compilers/mixins/visualstudio.py b/mesonbuild/compilers/mixins/visualstudio.py
index 3ba0610..2b173eb 100644
--- a/mesonbuild/compilers/mixins/visualstudio.py
+++ b/mesonbuild/compilers/mixins/visualstudio.py
@@ -125,6 +125,8 @@ class VisualStudioLikeCompiler(Compiler, metaclass=abc.ABCMeta):
self.machine = 'arm'
else:
self.machine = target
+ if mesonlib.version_compare(self.version, '>=19.29.29917'):
+ self.base_options.add(mesonlib.OptionKey('b_sanitize'))
assert self.linker is not None
self.linker.machine = self.machine
@@ -159,6 +161,13 @@ class VisualStudioLikeCompiler(Compiler, metaclass=abc.ABCMeta):
def get_no_optimization_args(self) -> T.List[str]:
return ['/Od']
+ def sanitizer_compile_args(self, value: str) -> T.List[str]:
+ if value == 'none':
+ return []
+ if value != 'address':
+ raise mesonlib.MesonException('VS only supports address sanitizer at the moment.')
+ return ['/fsanitize=address']
+
def get_output_args(self, target: str) -> T.List[str]:
if target.endswith('.exe'):
return ['/Fe' + target]