From: Eli Schwartz Date: Tue, 15 Jul 2025 14:22:07 GMT Subject: Re: [PATCH v3] meson: disable PCRE2 dependency by default in macOS Message-ID: In-Reply-To: On 7/15/25 8:01 AM, Carlo Arenas wrote: > On Mon, Jul 14, 2025 at 6:55 PM Eli Schwartz wrote: >> >> Please double-check my work, that this compiler.has_header() is >> sufficient on your reproducer system to detect and disable the >> non-working feature. > > it is indeed all that was needed, abd makes me wonder > if a future version of dependency() shouldn't have a "has_header" > parameter like the one used in find_libray() to allow for this > validation to happen internally and fallback as needed. It's... possible, I suppose, but usually not needed unless a distributor doesn't respond to reports that their OS is broken. Which well, fair enough, happens. :) Another possibility is to add a quirk to meson's underlying python code. If pcre2 is searched, and the platform is darwin, also check the header. You'll need a small override in mesonbuild/dependencies/*.py, like: class PCRE2PkgConfigDependency(PkgConfigDependency): def __init__(...): super().__init__(...) if is_darwin: self.is_found = check_that_header() > Posted a v4 with your code and modifications to still allow a > fallback to the wrap. Thanks. :) -- Eli Schwartz