[glib: 1/2] meson: use builtin zlib dependency lookup
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 1/2] meson: use builtin zlib dependency lookup
- Date: Thu, 26 May 2022 12:57:21 +0000 (UTC)
commit c630b4a5bcdecaf626f96b1db8c5e9c20f1cc653
Author: Eli Schwartz <eschwartz archlinux org>
Date: Tue May 24 15:22:34 2022 -0400
meson: use builtin zlib dependency lookup
Since Meson 0.54.0, `dependency('zlib')` will fallback on systems
without a pkg-config dependency, to a system dependency lookup that
performs the necessary `find_libary('z')` (or MSVC zlib/zlib1) and
`has_header('zlib.h')` checks.
This means all the manual lookups are no longer needed, and a single
dependency lookup covers all cases, and also clarifies the log lookup by
not sometimes listing "not found" a couple times.
meson.build | 23 +----------------------
1 file changed, 1 insertion(+), 22 deletions(-)
---
diff --git a/meson.build b/meson.build
index 366f0bf5e9..57a71f7694 100644
--- a/meson.build
+++ b/meson.build
@@ -2023,28 +2023,7 @@ endif
libm = cc.find_library('m', required : false)
libffi_dep = dependency('libffi', version : '>= 3.0.0', fallback : ['libffi', 'ffi_dep'])
-if get_option('wrap_mode') == 'forcefallback'
- # Respects "wrap_mode=forcefallback" option
- libz_dep = subproject('zlib').get_variable('zlib_dep')
-else
- # Don't use the bundled ZLib sources until we are sure that we can't find it on
- # the system
- libz_dep = dependency('zlib', required : false)
-endif
-
-if not libz_dep.found()
- if cc.get_id() != 'msvc' and cc.get_id() != 'clang-cl'
- libz_dep = cc.find_library('z', required : false)
- else
- libz_dep = cc.find_library('zlib1', required : false)
- if not libz_dep.found()
- libz_dep = cc.find_library('zlib', required : false)
- endif
- endif
- if not libz_dep.found() or not cc.has_header('zlib.h')
- libz_dep = subproject('zlib').get_variable('zlib_dep')
- endif
-endif
+libz_dep = dependency('zlib')
# First check in libc, fallback to libintl, and as last chance build
# proxy-libintl subproject.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]