mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-06 10:42:22 +00:00
meson: use better zlib dependency fallback
zlib is required, and if it isn't found it is checked several ways and
then forced via subproject(). This code was added in commit
b93e37592a
, to account for systems where
zlib doesn't have pkg-config files installed.
But Meson already does dependency fallback, and also, since 0.54.0, does
the in-between checks for find_library('z') and has_header('zlib.h') via
the "system" type dependency. Simplify dependency lookup by marking it
as required, which also makes sure that the console log doesn't
confusingly list "not found".
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2486>
This commit is contained in:
parent
b835a689b7
commit
7b3bccdd75
2 changed files with 2 additions and 14 deletions
|
@ -70,13 +70,7 @@ endif
|
||||||
core_conf.set('HAVE_ISO_CODES', have_iso_codes)
|
core_conf.set('HAVE_ISO_CODES', have_iso_codes)
|
||||||
|
|
||||||
# could drop optional zlib dep and use g_zlib_decompressor_new()
|
# could drop optional zlib dep and use g_zlib_decompressor_new()
|
||||||
zlib_dep = dependency('zlib', required : false)
|
zlib_dep = dependency('zlib')
|
||||||
if not zlib_dep.found()
|
|
||||||
zlib_dep = cc.find_library('z', required : false)
|
|
||||||
if not zlib_dep.found() or not cc.has_header('zlib.h')
|
|
||||||
zlib_dep = subproject('zlib').get_variable('zlib_dep')
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
core_conf.set('HAVE_ZLIB', true)
|
core_conf.set('HAVE_ZLIB', true)
|
||||||
|
|
||||||
tag_deps = [gst_base_dep, libm, zlib_dep]
|
tag_deps = [gst_base_dep, libm, zlib_dep]
|
||||||
|
|
|
@ -345,13 +345,7 @@ if have_gstgl
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
zlib_dep = dependency('zlib', required : false)
|
zlib_dep = dependency('zlib')
|
||||||
if not zlib_dep.found()
|
|
||||||
zlib_dep = cc.find_library('z', required : false)
|
|
||||||
if not zlib_dep.found() or not cc.has_header('zlib.h')
|
|
||||||
zlib_dep = subproject('zlib').get_variable('zlib_dep')
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
cdata.set('HAVE_ZLIB', true)
|
cdata.set('HAVE_ZLIB', true)
|
||||||
|
|
||||||
glib_deps = [dependency('glib-2.0', version : glib_req, fallback: ['glib', 'libglib_dep']),
|
glib_deps = [dependency('glib-2.0', version : glib_req, fallback: ['glib', 'libglib_dep']),
|
||||||
|
|
Loading…
Reference in a new issue