mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-10-06 01:12:40 +02:00
meson, plug-ins: further fix the no-pkg-config test for libmng.
As suggested by jeremyd2019 and Biswa96 of MSYS2 project, defining the MNG_USE_DLL macro would trigger libmng header code to fix the calling convention. This way, even the old detection code now works with Windows 32-bit. The reason why we still stick to this old detection code is that the pkg-config is likely not everywhere (e.g. in Debian package libmng-dev, there is no `.pc` file). So the pkg-config test is good but we still definitely need to keep our fallback more old-school test for this dependency. See this comment in particular: https://github.com/msys2/MINGW-packages/issues/11136#issuecomment-1084627263 Note: I am unsure yet how to apply the same trick on the autotools test because AC_CHECK_LIB() would allow us to tweak the cflags to define a macro, but we also need to include libmng.h header, otherwise the calling convention tweak is not run. It doesn't look to be feasible with the autoconf macro, or at least I haven't found how yet.
This commit is contained in:
10
meson.build
10
meson.build
@@ -661,8 +661,14 @@ MIMEtypes += [ 'image/png', 'image/x-icon']
|
||||
libmng = dependency('libmng', required: get_option('mng'))
|
||||
|
||||
if not libmng.found()
|
||||
libmng = cc.find_library('mng', required: get_option('mng'))
|
||||
if libmng.found() and not cc.has_function('mng_create', dependencies: libmng)
|
||||
libmng = cc.find_library('mng', required: get_option('mng'),)
|
||||
|
||||
mng_test_prefix = ''
|
||||
if platform_windows
|
||||
mng_test_prefix = '#define MNG_USE_DLL\n#include <libmng.h>'
|
||||
endif
|
||||
if libmng.found() and not cc.has_function('mng_create', dependencies: libmng,
|
||||
prefix: mng_test_prefix)
|
||||
libmng = no_dep
|
||||
endif
|
||||
endif
|
||||
|
@@ -111,8 +111,13 @@ if libjxl.found() and libjxl_threads.found()
|
||||
endif
|
||||
|
||||
if libmng.found()
|
||||
mng_cflags = []
|
||||
if platform_windows
|
||||
mng_cflags = [ '-DMNG_USE_DLL' ]
|
||||
endif
|
||||
common_plugins_list += { 'name': 'file-mng',
|
||||
'deps': [ gtk3, gegl, libmng, libpng, ],
|
||||
'deps': [ gtk3, gegl, libmng, libpng, ],
|
||||
'cflags': mng_cflags,
|
||||
}
|
||||
endif
|
||||
|
||||
|
Reference in New Issue
Block a user