From 925d70321feba75aebedbee9f9e3287417f899de Mon Sep 17 00:00:00 2001 From: Splendide Imaginarius <119545140+Splendide-Imaginarius@users.noreply.github.com> Date: Tue, 17 Oct 2023 06:14:20 +0000 Subject: [PATCH] Clarify Meson comment, improve formatting --- src/meson.build | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/meson.build b/src/meson.build index 9439999f..cceda73d 100755 --- a/src/meson.build +++ b/src/meson.build @@ -13,8 +13,15 @@ png = dependency('libpng', static: build_static) zlib = dependency('zlib', static: build_static) uchardet = dependency('uchardet', static: build_static) -# As no pkg-config file is generated for sdl2_image, and pkg-config is the default option for meson detecting dependencies, pkg-config will fail to find sdl2_image.pc in the build's lib/pkgconfig folder and instead pull it from the locally installed packages if it exists. -# We should first check to see if cmake can find our sdl2_image sub project and use that, then check using pkg-config as normal if we are not building the sub project. +# As no pkg-config file is generated for static sdl2_image, and pkg-config is +# the default option for meson detecting dependencies, pkg-config will fail to +# find sdl2_image.pc in the build's lib/pkgconfig folder and instead pull it +# from the locally installed packages if it exists. +# To work around this, we first check to see if cmake can find our sdl2_image +# sub project and use that, then check using pkg-config as normal if we are not +# building the sub project. +# It looks like upstream SDL_image fixed this for SDL3, so we can hopefully +# remove this workaround after eventually upgrading to SDL3. sdl2_image = dependency('SDL2_image', modules: ['SDL2_image::SDL2_image-static', 'SDL2_image::brotlidec-static', 'SDL2_image::brotlicommon-static', 'SDL2_image::hwy', 'SDL2_image::jxl_dec-static'], static: build_static, method: 'cmake', required: false) if sdl2_image.found() == false sdl2_image = dependency('SDL2_image', modules: ['SDL2_image::SDL2_image-static', 'SDL2_image::brotlidec-static', 'SDL2_image::brotlicommon-static', 'SDL2_image::hwy', 'SDL2_image::jxl_dec-static'], static: build_static)