diff options
-rw-r--r-- | mesonbuild/compilers/cpp.py | 1 | ||||
-rw-r--r-- | mesonbuild/compilers/mixins/visualstudio.py | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py index 4d55ccd..d0e3fd2 100644 --- a/mesonbuild/compilers/cpp.py +++ b/mesonbuild/compilers/cpp.py @@ -663,7 +663,6 @@ class VisualStudioCPPCompiler(CPP11AsCPP14Mixin, VisualStudioLikeCPPCompilerMixi CPPCompiler.__init__(self, exelist, version, for_machine, is_cross, info, exe_wrapper, linker=linker, full_version=full_version) MSVCCompiler.__init__(self, target) - self.base_options = {OptionKey(o) for o in ['b_pch', 'b_vscrt', 'b_ndebug']} # FIXME add lto, pgo and the like self.id = 'msvc' def get_options(self) -> 'KeyedOptionDictType': 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] |