meson: Fix pcre static flag usage with a subproject

This commit is contained in:
Nirbheek Chauhan 2022-12-30 16:53:10 +05:30
parent a395a7ab3d
commit 6abafd64d8

View File

@ -2056,7 +2056,10 @@ endif
# Try again with the fallback
if not pcre2.found()
pcre2 = dependency('libpcre2-8', version: pcre2_req, allow_fallback: true)
use_pcre2_static_flag = true
assert(pcre2.type_name() == 'internal')
# static flags are automatically enabled by the subproject if it's built
# with default_library=static
use_pcre2_static_flag = false
elif host_system == 'windows'
pcre2_static = cc.links('''#define PCRE2_STATIC
#define PCRE2_CODE_UNIT_WIDTH 8