|
Packit |
a4058c |
subdir('pixops')
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
# Loader libs
|
|
Packit |
a4058c |
# - name
|
|
Packit |
a4058c |
# - sources
|
|
Packit |
a4058c |
# - conditional, otherwise always built
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
# We need to disable the in-house loaders for BMP, GIF and ICO
|
|
Packit |
a4058c |
# when enable_native_windows_loaders is true
|
|
Packit |
a4058c |
loaders = [
|
|
Packit |
a4058c |
[ 'png', [ 'io-png.c' ], enabled_loaders.contains('png') ],
|
|
Packit |
a4058c |
[ 'bmp', [ 'io-bmp.c' ], not enable_native_windows_loaders ],
|
|
Packit |
a4058c |
[ 'gif', [ 'io-gif.c', 'io-gif-animation.c' ], not enable_native_windows_loaders ],
|
|
Packit |
a4058c |
[ 'ico', [ 'io-ico.c' ], not enable_native_windows_loaders ],
|
|
Packit |
a4058c |
[ 'ani', [ 'io-ani.c', 'io-ani-animation.c' ] ],
|
|
Packit |
a4058c |
[ 'jpeg', [ 'io-jpeg.c' ], enabled_loaders.contains('jpeg') ],
|
|
Packit |
a4058c |
[ 'pnm', [ 'io-pnm.c' ] ],
|
|
Packit |
a4058c |
[ 'tiff', [ 'io-tiff.c' ], enabled_loaders.contains('tiff') ],
|
|
Packit |
a4058c |
[ 'xpm', [ 'io-xpm.c' ] ],
|
|
Packit |
a4058c |
[ 'xbm', [ 'io-xbm.c' ] ],
|
|
Packit |
a4058c |
[ 'tga', [ 'io-tga.c', 'gdk-pixbuf-buffer-queue.c' ] ],
|
|
Packit |
a4058c |
[ 'icns', [ 'io-icns.c' ] ],
|
|
Packit |
a4058c |
[ 'jasper', [ 'io-jasper.c' ], enabled_loaders.contains('jasper'), jasper_extra_cflags ],
|
|
Packit |
a4058c |
[ 'qtif', [ 'io-qtif.c' ] ]
|
|
Packit |
a4058c |
]
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
gdk_pixbuf_inc = include_directories('.')
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
gdk_pixbuf_cflags = [
|
|
Packit |
a4058c |
'-DG_LOG_STRUCTURED=1',
|
|
Packit |
a4058c |
'-DG_LOG_DOMAIN="GdkPixbuf"',
|
|
Packit |
a4058c |
'-DGDK_PIXBUF_COMPILATION',
|
|
Packit |
a4058c |
'-DGDK_PIXBUF_PREFIX="@0@"'.format(gdk_pixbuf_prefix),
|
|
Packit |
a4058c |
'-DGDK_PIXBUF_LOCALEDIR="@0@"'.format(gdk_pixbuf_localedir),
|
|
Packit |
a4058c |
'-DGDK_PIXBUF_LIBDIR="@0@"'.format(gdk_pixbuf_libdir),
|
|
Packit |
a4058c |
'-DGDK_PIXBUF_BINARY_VERSION="@0@"'.format(gdk_pixbuf_binary_version),
|
|
Packit |
a4058c |
'-DGDK_PIXBUF_ENABLE_BACKEND',
|
|
Packit |
a4058c |
'-DPIXBUF_LIBDIR="@0@"'.format(gdk_pixbuf_loaderdir),
|
|
Packit |
a4058c |
'-DBUILT_MODULES_DIR="@0@"'.format(meson.current_build_dir()),
|
|
Packit |
a4058c |
]
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
gdk_pixbuf_api_path = join_paths(gdk_pixbuf_api_name, 'gdk-pixbuf')
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
gdkpixbuf_features_conf = configuration_data()
|
|
Packit |
a4058c |
gdkpixbuf_features_conf.set('GDK_PIXBUF_MAJOR', gdk_pixbuf_version_major)
|
|
Packit |
a4058c |
gdkpixbuf_features_conf.set('GDK_PIXBUF_MINOR', gdk_pixbuf_version_minor)
|
|
Packit |
a4058c |
gdkpixbuf_features_conf.set('GDK_PIXBUF_MICRO', gdk_pixbuf_version_micro)
|
|
Packit |
a4058c |
gdkpixbuf_features_conf.set('GDK_PIXBUF_VERSION', meson.project_version())
|
|
Packit |
a4058c |
gdkpixbuf_features_conf.set('GDK_PIXBUF_API_VERSION', gdk_pixbuf_api_version)
|
|
Packit |
a4058c |
gdkpixbuf_features_conf.set('LT_CURRENT_MINUS_AGE', current_minus_age)
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
gdk_pixbuf_features_h = configure_file(input: 'gdk-pixbuf-features.h.in',
|
|
Packit |
a4058c |
output: 'gdk-pixbuf-features.h',
|
|
Packit |
a4058c |
configuration: gdkpixbuf_features_conf,
|
|
Packit |
a4058c |
install: true,
|
|
Packit |
a4058c |
install_dir: join_paths(gdk_pixbuf_includedir, gdk_pixbuf_api_path))
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
gdkpixbuf_headers = [
|
|
Packit |
a4058c |
'gdk-pixbuf.h',
|
|
Packit |
a4058c |
'gdk-pixbuf-animation.h',
|
|
Packit |
a4058c |
'gdk-pixbuf-autocleanups.h',
|
|
Packit |
a4058c |
'gdk-pixbuf-core.h',
|
|
Packit |
a4058c |
'gdk-pixbuf-io.h',
|
|
Packit |
a4058c |
'gdk-pixbuf-loader.h',
|
|
Packit |
a4058c |
'gdk-pixbuf-macros.h',
|
|
Packit |
a4058c |
'gdk-pixbuf-simple-anim.h',
|
|
Packit |
a4058c |
'gdk-pixbuf-transform.h',
|
|
Packit |
a4058c |
]
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
install_headers(gdkpixbuf_headers + [ 'gdk-pixdata.h' ], subdir: gdk_pixbuf_api_path)
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
gdkpixbuf_sources = [
|
|
Packit |
a4058c |
'gdk-pixbuf.c',
|
|
Packit |
a4058c |
'gdk-pixbuf-animation.c',
|
|
Packit |
a4058c |
'gdk-pixbuf-data.c',
|
|
Packit |
a4058c |
'gdk-pixbuf-io.c',
|
|
Packit |
a4058c |
'gdk-pixbuf-loader.c',
|
|
Packit |
a4058c |
'gdk-pixbuf-scale.c',
|
|
Packit |
a4058c |
'gdk-pixbuf-simple-anim.c',
|
|
Packit |
a4058c |
'gdk-pixbuf-scaled-anim.c',
|
|
Packit |
a4058c |
'gdk-pixbuf-util.c',
|
|
Packit |
a4058c |
'gdk-pixdata.c',
|
|
Packit |
a4058c |
]
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
gdkpixbuf_marshals = gnome.genmarshal('gdk-pixbuf-marshal',
|
|
Packit |
a4058c |
sources: 'gdk-pixbuf-marshal.list',
|
|
Packit |
a4058c |
prefix: '_gdk_pixbuf_marshal')
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
gdkpixbuf_enums = gnome.mkenums('gdk-pixbuf-enum-types',
|
|
Packit |
a4058c |
sources: gdkpixbuf_headers,
|
|
Packit |
a4058c |
c_template: 'gdk-pixbuf-enum-types.c.template',
|
|
Packit |
a4058c |
h_template: 'gdk-pixbuf-enum-types.h.template',
|
|
Packit |
a4058c |
install_header: true,
|
|
Packit |
a4058c |
install_dir: join_paths(gdk_pixbuf_includedir, gdk_pixbuf_api_path))
|
|
Packit |
a4058c |
gdkpixbuf_enum_h = gdkpixbuf_enums[1]
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
if host_system == 'windows'
|
|
Packit |
a4058c |
gdk_pixbuf_win_rc = configure_file(
|
|
Packit |
a4058c |
input: 'gdk_pixbuf.rc.in',
|
|
Packit |
a4058c |
output: 'gdk_pixbuf.rc',
|
|
Packit |
a4058c |
configuration: gdkpixbuf_features_conf,
|
|
Packit |
a4058c |
)
|
|
Packit |
a4058c |
gdk_pixbuf_win_res = import('windows').compile_resources(gdk_pixbuf_win_rc)
|
|
Packit |
a4058c |
gdkpixbuf_sources += gdk_pixbuf_win_res
|
|
Packit |
a4058c |
endif
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
# Check if we need to build loaders as built-in functionality
|
|
Packit |
a4058c |
included_loaders_cflags = []
|
|
Packit |
a4058c |
included_loaders_deps = []
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
foreach l: loaders
|
|
Packit |
a4058c |
name = l[0]
|
|
Packit |
a4058c |
sources = l[1]
|
|
Packit |
a4058c |
cond = l.get(2, true)
|
|
Packit |
a4058c |
cflags = l.get(3, [])
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
if cond and (builtin_loaders.contains(name) or builtin_all_loaders)
|
|
Packit |
a4058c |
cflag_for_included_loader = ['-DINCLUDE_@0@'.format(name)]
|
|
Packit |
a4058c |
included_loaders_cflags += cflag_for_included_loader
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
mod = static_library('staticpixbufloader-@0@'.format(name),
|
|
Packit |
a4058c |
sources,
|
|
Packit |
a4058c |
dependencies: loaders_deps + gdk_pixbuf_deps,
|
|
Packit |
a4058c |
include_directories: [ root_inc, gdk_pixbuf_inc ],
|
|
Packit |
a4058c |
c_args: common_cflags + gdk_pixbuf_cflags + cflags + cflag_for_included_loader)
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
included_loaders_deps += declare_dependency(link_with: mod)
|
|
Packit |
a4058c |
endif
|
|
Packit |
a4058c |
endforeach
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
# List of formats supported by the native Windows components-based loader(s)
|
|
Packit |
a4058c |
windows_native_loader_formats = [ 'bmp', 'emf', 'gif', 'ico', 'jpeg', 'tiff', 'wmf' ]
|
|
Packit |
a4058c |
windows_base_loader_sources = [ 'io-gdip-utils.c', 'io-gdip-animation.c' ]
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
# Build the loaders using native Windows components as static modules, if requested
|
|
Packit |
a4058c |
if enable_native_windows_loaders
|
|
Packit |
a4058c |
if builtin_loaders.contains('windows') or builtin_all_loaders
|
|
Packit |
a4058c |
cflag_for_included_loader = ['-DINCLUDE_gdiplus']
|
|
Packit |
a4058c |
included_loaders_cflags += cflag_for_included_loader
|
|
Packit |
a4058c |
win_loader_sources = windows_base_loader_sources
|
|
Packit |
a4058c |
foreach loader: windows_native_loader_formats
|
|
Packit |
a4058c |
win_loader_sources += 'io-gdip-@0@.c'.format(loader)
|
|
Packit |
a4058c |
endforeach
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
mod = static_library('staticpixbufloader-gdiplus',
|
|
Packit |
a4058c |
win_loader_sources,
|
|
Packit |
a4058c |
dependencies: loaders_deps + gdk_pixbuf_deps,
|
|
Packit |
a4058c |
include_directories: [ root_inc, gdk_pixbuf_inc ],
|
|
Packit |
a4058c |
c_args: common_cflags + gdk_pixbuf_cflags + cflag_for_included_loader)
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
included_loaders_deps += declare_dependency(link_with: mod)
|
|
Packit |
a4058c |
endif
|
|
Packit |
a4058c |
endif
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
# The main gdk-pixbuf shared library
|
|
Packit |
a4058c |
gdkpixbuf = library('gdk_pixbuf-2.0',
|
|
Packit |
a4058c |
gdkpixbuf_sources + gdkpixbuf_enums + gdkpixbuf_marshals,
|
|
Packit |
a4058c |
soversion: soversion,
|
|
Packit |
a4058c |
version: libversion,
|
|
Packit |
a4058c |
c_args: common_cflags + gdk_pixbuf_cflags + included_loaders_cflags,
|
|
Packit |
a4058c |
link_args: common_ldflags,
|
|
Packit |
a4058c |
include_directories: root_inc,
|
|
Packit |
a4058c |
dependencies: gdk_pixbuf_deps + included_loaders_deps + [ pixops_dep ],
|
|
Packit |
a4058c |
install: true)
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
gdkpixbuf_dep = declare_dependency(link_with: gdkpixbuf,
|
|
Packit |
a4058c |
include_directories: root_inc,
|
|
Packit |
a4058c |
dependencies: gdk_pixbuf_deps,
|
|
Packit |
a4058c |
sources: gdkpixbuf_enum_h)
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
# Now check if we are building loaders as installed shared modules
|
|
Packit |
a4058c |
# We do this here because shared modules depend on libgdk-pixbuf
|
|
Packit |
a4058c |
dynamic_loaders = []
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
foreach l: loaders
|
|
Packit |
a4058c |
name = l[0]
|
|
Packit |
a4058c |
sources = l[1]
|
|
Packit |
a4058c |
cond = l.get(2, true)
|
|
Packit |
a4058c |
cflags = l.get(3, [])
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
if cond and not (builtin_loaders.contains(name) or builtin_all_loaders)
|
|
Packit |
a4058c |
mod = shared_module('pixbufloader-@0@'.format(name),
|
|
Packit |
a4058c |
sources,
|
|
Packit |
a4058c |
dependencies: loaders_deps + gdk_pixbuf_deps + [ gdkpixbuf_dep ],
|
|
Packit |
a4058c |
include_directories: [ root_inc, gdk_pixbuf_inc ],
|
|
Packit |
a4058c |
c_args: common_cflags + gdk_pixbuf_cflags + cflags,
|
|
Packit |
a4058c |
install: true,
|
|
Packit |
a4058c |
install_dir: gdk_pixbuf_loaderdir)
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
# We need the path to build loaders.cache for tests
|
|
Packit |
a4058c |
dynamic_loaders += mod.full_path()
|
|
Packit |
a4058c |
endif
|
|
Packit |
a4058c |
endforeach
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
# Build the loaders using native Windows components as dynamic modules, if requested
|
|
Packit |
a4058c |
if enable_native_windows_loaders
|
|
Packit |
a4058c |
if not (builtin_loaders.contains('windows') or builtin_all_loaders)
|
|
Packit |
a4058c |
foreach loader: windows_native_loader_formats
|
|
Packit |
a4058c |
loader_sources = windows_base_loader_sources + [ 'io-gdip-@0@.c'.format(loader) ]
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
mod = shared_module('pixbufloader-gdip-@0@'.format(loader),
|
|
Packit |
a4058c |
loader_sources,
|
|
Packit |
a4058c |
dependencies: loaders_deps + gdk_pixbuf_deps + [ gdkpixbuf_dep ],
|
|
Packit |
a4058c |
include_directories: [ root_inc, gdk_pixbuf_inc ],
|
|
Packit |
a4058c |
c_args: common_cflags + gdk_pixbuf_cflags + cflags,
|
|
Packit |
a4058c |
install: true,
|
|
Packit |
a4058c |
install_dir: gdk_pixbuf_loaderdir)
|
|
Packit |
a4058c |
dynamic_loaders += mod.full_path()
|
|
Packit |
a4058c |
endforeach
|
|
Packit |
a4058c |
endif
|
|
Packit |
a4058c |
endif
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
gdkpixbuf_bin = [
|
|
Packit |
a4058c |
[ 'gdk-pixbuf-csource' ],
|
|
Packit |
a4058c |
[ 'gdk-pixbuf-pixdata' ],
|
|
Packit |
a4058c |
[ 'gdk-pixbuf-query-loaders', [ 'queryloaders.c' ] ],
|
|
Packit |
a4058c |
]
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
foreach bin: gdkpixbuf_bin
|
|
Packit |
a4058c |
bin_name = bin[0]
|
|
Packit |
a4058c |
bin_source = bin.get(1, bin_name + '.c')
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
bin = executable(bin_name, bin_source,
|
|
Packit |
a4058c |
dependencies: gdk_pixbuf_deps + [ gdkpixbuf_dep ],
|
|
Packit |
a4058c |
include_directories: [ root_inc, gdk_pixbuf_inc ],
|
|
Packit |
a4058c |
c_args: common_cflags + gdk_pixbuf_cflags,
|
|
Packit |
a4058c |
install: true)
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
# Used in tests
|
|
Packit |
a4058c |
set_variable(bin_name.underscorify(), bin)
|
|
Packit |
a4058c |
endforeach
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
# The 'loaders.cache' used for testing, so we don't accidentally
|
|
Packit |
a4058c |
# load the installed cache; we always build it by default
|
|
Packit |
a4058c |
loaders_cache = custom_target('loaders.cache',
|
|
Packit |
a4058c |
output: 'loaders.cache',
|
|
Packit |
a4058c |
capture: true,
|
|
Packit |
a4058c |
command: [
|
|
Packit |
a4058c |
gdk_pixbuf_query_loaders,
|
|
Packit |
a4058c |
dynamic_loaders,
|
|
Packit |
a4058c |
],
|
|
Packit |
a4058c |
build_by_default: true)
|
|
Packit |
a4058c |
loaders_dep = declare_dependency(sources: [ loaders_cache ])
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
build_gir = get_option('with_gir') and not meson.is_cross_build()
|
|
Packit |
a4058c |
if build_gir
|
|
Packit |
a4058c |
gir_args = [
|
|
Packit |
a4058c |
'--quiet',
|
|
Packit |
a4058c |
'--c-include=gdk-pixbuf/gdk-pixbuf.h',
|
|
Packit |
a4058c |
'-DGDK_PIXBUF_COMPILATION',
|
|
Packit |
a4058c |
]
|
|
Packit |
a4058c |
|
|
Packit |
a4058c |
gnome.generate_gir(gdkpixbuf,
|
|
Packit |
a4058c |
sources: gdkpixbuf_sources + gdkpixbuf_headers + gdkpixbuf_enums + [
|
|
Packit |
a4058c |
gdk_pixbuf_features_h,
|
|
Packit |
a4058c |
'gdk-pixdata.h',
|
|
Packit |
a4058c |
],
|
|
Packit |
a4058c |
namespace: 'GdkPixbuf',
|
|
Packit |
a4058c |
nsversion: gdk_pixbuf_api_version,
|
|
Packit |
a4058c |
identifier_prefix: 'Gdk',
|
|
Packit |
a4058c |
symbol_prefix: 'gdk',
|
|
Packit |
a4058c |
export_packages: 'gdk-pixbuf-2.0',
|
|
Packit |
a4058c |
includes: [ 'GModule-2.0', 'Gio-2.0', ],
|
|
Packit |
a4058c |
install: true,
|
|
Packit |
a4058c |
extra_args: gir_args)
|
|
Packit |
a4058c |
endif
|