Skip to content

meson: Fix Windows build with PCRE2 as sibling subproject

Benjamin Gilbert requested to merge bgilbert/glib:pcre2 into main

If glib and PCRE2 are both built for Windows as subprojects of a parent project, cc.links() will fail because PCRE2 hasn't been built yet when glib is being configured:

subprojects/glib-2.78.0/meson.build:2109:20: ERROR: Dependencies must be external dependencies

!3177 (merged) changed the detection logic to avoid cc.links() in this case, but !3470 (merged) broke it again. PCRE2 detection could use a broader cleanup, but for now, make the minimum change to fix this case.

use_pcre2_static_flag ends up set to false, matching the behavior of !3177 (merged).

Edited by Benjamin Gilbert

Merge request reports