From c1a46ecfafdaef77da72613850efbf2f61461391 Mon Sep 17 00:00:00 2001 From: Crend King <975235+CrendKing@users.noreply.github.com> Date: Wed, 15 Jun 2022 15:06:56 -0700 Subject: [PATCH] meson: rearrange library dependency order to avoid crash with fontconfig In win32 build, if libass and libfontconfig appear after libmingwex during linking, crash happens whenever fontconfig calls to opendir(). Moving them before ffmpeg makes sure they always appear first. More info on https://github.com/shinchiro/mpv-winbuild-cmake/issues/217. --- meson.build | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index b8db70f923..a33ff141cb 100644 --- a/meson.build +++ b/meson.build @@ -30,8 +30,10 @@ ffmpeg = { libass = dependency('libass', version: '>= 0.12.2') pthreads = dependency('threads') -dependencies = [ffmpeg['deps'], - libass, +# the dependency order of libass -> ffmpeg is necessary due to +# static linking symbol resolution between fontconfig and MinGW +dependencies = [libass, + ffmpeg['deps'], pthreads] features = [ffmpeg['name'], libass.name(), pthreads.name()]