meson/mesonbuild/compilers
Patrick Steinhardt 43ea11ea49 compilers: convert `b_sanitize` to a free-form array option
In the preceding commit we have started to perform compiler checks for
the value of `b_sanitize`, which allows us to detect sanitizers that
aren't supported by the compiler toolchain. But we haven't yet loosened
the option itself to accept arbitrary values, so until now it's still
only possible to pass sanitizer combinations known by Meson, which is
quite restrictive.

Lift that restriction by adapting the `b_sanitize` option to become a
free-form array. Like this, users can pass whatever combination of
comma-separated sanitizers to Meson, which will then figure out whether
that combination is supported via the compiler checks. This lifts a
couple of restrictions and makes the supporting infrastructure way more
future proof.

A couple of notes regarding backwards compatibility:

  - All previous values of `b_sanitize` will remain valid as the syntax
    for free-form array values and valid combo choices is the same. We
    also treat 'none' specially so that we know to convert it into an
    empty array.

  - Even though the option has been converted into a free-form array,
    callers of `get_option('b_sanitize')` continue to get a string as
    value. We may eventually want to introduce a kwarg to alter this
    behaviour, but for now it is expected to be good enough for most use
    cases.

Fixes #8283
Fixes #7761
Fixes #5154
Fixes #1582

Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
2025-03-09 18:06:14 -04:00
..
mixins compilers: convert `b_sanitize` to a free-form array option 2025-03-09 18:06:14 -04:00
__init__.py compilers: Remove the BaseOption type 2025-03-03 11:26:23 -08:00
asm.py
c.py Fixes issue 14089 (detection of Intel compiler) 2025-02-27 07:12:21 -08:00
c_function_attributes.py
compilers.py compilers: convert `b_sanitize` to a free-form array option 2025-03-09 18:06:14 -04:00
cpp.py Make all Meson level options overridable per subproject. 2025-02-13 23:57:48 +02:00
cs.py
cuda.py compilers: convert `b_sanitize` to a free-form array option 2025-03-09 18:06:14 -04:00
cython.py Make all Meson level options overridable per subproject. 2025-02-13 23:57:48 +02:00
d.py
detect.py compilers/detect: Split -beta and -nightly suffixes from rustc 2025-02-27 15:27:42 -05:00
fortran.py Make all Meson level options overridable per subproject. 2025-02-13 23:57:48 +02:00
java.py
objc.py Make all Meson level options overridable per subproject. 2025-02-13 23:57:48 +02:00
objcpp.py Make all Meson level options overridable per subproject. 2025-02-13 23:57:48 +02:00
rust.py compilers/rust: implement has_argument checks 2025-03-09 18:06:14 -04:00
swift.py swift: Add swift_std compiler option 2025-03-01 12:37:46 +02:00
vala.py Make all Meson level options overridable per subproject. 2025-02-13 23:57:48 +02:00