[gimp/wip/Jehan/meson-windows-official] meson: fix libmng test.
- From: Jehan <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/wip/Jehan/meson-windows-official] meson: fix libmng test.
- Date: Thu, 31 Mar 2022 15:04:26 +0000 (UTC)
commit e2b7b60d5b45c11bc152d929b8c7f0531a2c5a0f
Author: Jehan <jehan girinstud io>
Date: Thu Mar 31 14:42:29 2022 +0200
meson: fix libmng test.
The main problem was that file-mng would fail to build on Windows 32-bit
even though the lib was detected. Actually this is because there are
several possible calling conventions and this can be handled by defining
the proper macro. This macro is well defined in the pkg-config file, but
our build was not using it.
So let's change the test to use pkg-config first. If this fails, we
fallback to more basic method of finding the library. Additionally we
augment this fallback test with a function check (as we do already in
autotools) so that our configure test is reliable: we verify that the
lib is there **and** that symbols are visible. Otherwise we'd end up
with a successful configure test followed by a broken build (as until
now in meson).
See the nice explanation here and in next messages:
https://github.com/msys2/MINGW-packages/issues/11136#issuecomment-1083711452
meson.build | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/meson.build b/meson.build
index dd74ad6a59..0227e9524e 100644
--- a/meson.build
+++ b/meson.build
@@ -658,7 +658,14 @@ libpng_minver = '1.6.25'
libpng = dependency('libpng', version: '>='+libpng_minver)
MIMEtypes += [ 'image/png', 'image/x-icon']
-libmng = cc.find_library('mng', required: get_option('mng'))
+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 = no_dep
+ endif
+endif
libaa = cc.find_library('aa', required: get_option('aa'))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]