Build PNG from subproject if it depends on internal deps

This commit is contained in:
kcgen 2023-12-13 08:18:34 -08:00 committed by kcgen
parent 918896df98
commit 53c8010178

View file

@ -516,13 +516,6 @@ opus_dep = dependency(
include_type: 'system',
)
png_dep = dependency(
'libpng',
version: ['>= 1.2', '< 2'],
static: ('png' in static_libs_list or prefers_static_libs),
include_type: 'system',
)
sdl2_dep = dependency(
'sdl2',
version: ['>= 2.0.5', '< 3'],
@ -627,6 +620,29 @@ if not zlib_dep.found()
summary('zlib provider', 'system library')
endif
# PNG
# ~~~
png_has_internal_dep = zlib_dep.type_name() == 'internal'
if png_has_internal_dep
png_dep = subproject(
'libpng',
default_options: default_wrap_options,
).get_variable('png_dep')
else
png_dep = dependency(
'libpng',
version: ['>= 1.2', '< 2'],
required: true,
fallback: [],
static: 'png' in static_libs_list or prefers_static_libs,
include_type: 'system',
)
endif
summary(
'PNG provider',
png_dep.type_name() == 'internal' ? 'built-in' : 'system library',
)
# SpeexDSP
# ~~~~~~~~
# Default to the system library