diff --git a/meson.build b/meson.build index caad34185b7..73f46285fd4 100644 --- a/meson.build +++ b/meson.build @@ -1054,7 +1054,10 @@ if not perlopt.disabled() if cc.get_id() == 'msvc' # prevent binary mismatch between MSVC built plperl and Strawberry or # msys ucrt perl libraries - perl_ccflags += ['-DNO_THREAD_SAFE_LOCALE'] + perl_v = run_command(perl, '-V').stdout() + if not perl_v.contains('USE_THREAD_SAFE_LOCALE') + perl_ccflags += ['-DNO_THREAD_SAFE_LOCALE'] + endif endif endif