summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2017-09-07 18:06:50 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2017-09-07 18:09:47 +0800
commit7386e44bbf42359a71027d108d98afc7e454282d (patch)
treebe52865e87219284058672f7b317c11cb2d66ecc /meson.build
parent859581953212b1b6950418f26e200a4bfa316432 (diff)
downloadgdk-pixbuf-7386e44bbf42359a71027d108d98afc7e454282d.tar.gz
build: Support Windows components-based loader
There is currently a GDI+ image loader that is within the GDK-Pixbuf codebase, which can serve as a basis for improvements to it or for moving on to more modern Windows APIs/Frameworks such as Windows Imaging Component (WIC). Provide a Windows-only option to build it with Meson, which will mean that when it is used the TIFF and JPEG loaders will not require libtiff and libjpeg-turbo/IJG JPEG, but will use the GDI+ component of Windows to deal with these images, along with BMP, GIF, ICO and images. This will also enable the support of EMF and WMF images. For building this set of loaders into the GDK-Pixbuf DLL, pass in 'windows' as a part of the loaders passed into builtin_loaders, or pass in 'all' to builtin_loaders in conjunction with this option. This also means that by using this set of GDI+ loaders, we cannot use any of the loaders (either in-house or those using the various opensource libraries) for these formats, so these loaders will be disabled as a result, since the MIME types, extensions and signature of these formats are the same in the GDI+ loaders with their respective counterparts that are otherwise built. Note that PNG support still requires libpng, and JPEG2000 support still requires libjasper, and in its current state, the TIFF and JPEG and ICO (and hence ANI) support that are done by the opensource libraries and/or the in-house loaders are still preferred over the GDI+-based ones since in the current state they tend to work better, so this is provided as an option. https://bugzilla.gnome.org/show_bug.cgi?id=785767
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build32
1 files changed, 25 insertions, 7 deletions
diff --git a/meson.build b/meson.build
index c8f1638b2..4d5cf4aaf 100644
--- a/meson.build
+++ b/meson.build
@@ -227,15 +227,24 @@ if get_option('enable_png')
endforeach
endif
-if get_option('enable_tiff')
- tiff_dep = dependency('libtiff-4', required: false)
- if tiff_dep.found()
- enabled_loaders += 'tiff'
- loaders_deps += tiff_dep
- endif
+# On Windows, check whether we are building the native Windows loaders
+# (it is an "all-or-nothing" option for BMP, EMF, GIF, ICO, JPEG, TIFF and WMF)
+# Note that we currently do not use the native Windows loaders to handle PNG and
+# JPEG2000 images
+if host_system == 'windows'
+ enable_native_windows_loaders = get_option('enable_native_windows_loaders')
+else
+ enable_native_windows_loaders = false
+endif
+
+if enable_native_windows_loaders
+ loaders_deps += cc.find_library('gdiplus')
+ loaders_deps += cc.find_library('ole32')
+ enabled_loaders += 'gdiplus'
endif
-if get_option('enable_jpeg')
+# Don't check and build the jpeg loader if enable_native_windows_loaders is true
+if get_option('enable_jpeg') and not enable_native_windows_loaders
if cc.has_header('jpeglib.h')
jpeg_dep = cc.find_library('jpeg', required: false)
if cc.get_id() == 'msvc' and not jpeg_dep.found()
@@ -253,6 +262,15 @@ if get_option('enable_jpeg')
endif
endif
+# Don't check and build the tiff loader if enable_native_windows_loaders is true
+if get_option('enable_tiff') and not enable_native_windows_loaders
+ tiff_dep = dependency('libtiff-4', required: false)
+ if tiff_dep.found()
+ enabled_loaders += 'tiff'
+ loaders_deps += tiff_dep
+ endif
+endif
+
jasper_extra_cflags = []
if get_option('enable_jasper')