interpreter: Don't warn on -fsanitze-*

We really only want to warn on `-fsanitize=foo` or `-fsanitize foo`, but
not things like `-fsanitize-recover=...`

Fixes #9822
Fixes #7192
This commit is contained in:
Dylan Baker 2022-01-13 09:54:11 -08:00 committed by Eli Schwartz
parent 67c51820b7
commit 8db1ca1766
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
1 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2012-2021 The Meson development team
# Copyright © 2023 Intel Corporation
from __future__ import annotations
@ -2922,7 +2923,8 @@ class Interpreter(InterpreterBase, HoldableObject):
elif arg == '-g':
mlog.warning(f'Consider using the built-in debug option instead of using "{arg}".',
location=self.current_node)
elif arg.startswith('-fsanitize'):
# Don't catch things like `-fsanitize-recover`
elif arg == '-fsanitize' or arg.startswith('-fsanitize='):
mlog.warning(f'Consider using the built-in option for sanitizers instead of using "{arg}".',
location=self.current_node)
elif arg.startswith('-std=') or arg.startswith('/std:'):