Skip to content

Commit

Permalink
build-sys: add a "pixman" feature
Browse files Browse the repository at this point in the history
For now, pixman is mandatory, but we set config_host.h and Kconfig.
Once compilation is fixed, "pixman" will become actually optional.

Signed-off-by: Marc-André Lureau <[email protected]>
Reviewed-by: Thomas Huth <[email protected]>
  • Loading branch information
elmarco committed Nov 7, 2023
1 parent bb541a7 commit cca1575
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Kconfig.host
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ config OPENGL
config X11
bool

config PIXMAN
bool

config SPICE
bool

Expand Down
2 changes: 2 additions & 0 deletions include/ui/qemu-pixman.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
#ifndef QEMU_PIXMAN_H
#define QEMU_PIXMAN_H

#ifdef CONFIG_PIXMAN
/* pixman-0.16.0 headers have a redundant declaration */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wredundant-decls"
#include <pixman.h>
#pragma GCC diagnostic pop
#endif

/*
* pixman image formats are defined to be native endian,
Expand Down
10 changes: 8 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -813,10 +813,14 @@ if 'ust' in get_option('trace_backends')
method: 'pkg-config')
endif
pixman = not_found
if have_system or have_tools
pixman = dependency('pixman-1', required: have_system, version:'>=0.21.8',
if not get_option('pixman').auto() or have_system or have_tools
pixman = dependency('pixman-1', required: get_option('pixman'), version:'>=0.21.8',
method: 'pkg-config')
endif
if not pixman.found() and (have_system or have_tools)
error('FIXME: pixman is currently required')
endif

zlib = dependency('zlib', required: true)

libaio = not_found
Expand Down Expand Up @@ -2149,6 +2153,7 @@ config_host_data.set('CONFIG_SECCOMP', seccomp.found())
if seccomp.found()
config_host_data.set('CONFIG_SECCOMP_SYSRAWRC', seccomp_has_sysrawrc)
endif
config_host_data.set('CONFIG_PIXMAN', pixman.found())
config_host_data.set('CONFIG_SNAPPY', snappy.found())
config_host_data.set('CONFIG_SOLARIS', targetos == 'sunos')
if get_option('tcg').allowed()
Expand Down Expand Up @@ -2868,6 +2873,7 @@ have_ivshmem = config_host_data.get('CONFIG_EVENTFD')
host_kconfig = \
(get_option('fuzzing') ? ['CONFIG_FUZZ=y'] : []) + \
(have_tpm ? ['CONFIG_TPM=y'] : []) + \
(pixman.found() ? ['CONFIG_PIXMAN=y'] : []) + \
(spice.found() ? ['CONFIG_SPICE=y'] : []) + \
(have_ivshmem ? ['CONFIG_IVSHMEM=y'] : []) + \
(opengl.found() ? ['CONFIG_OPENGL=y'] : []) + \
Expand Down
2 changes: 2 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ option('l2tpv3', type : 'feature', value : 'auto',
description: 'l2tpv3 network backend support')
option('netmap', type : 'feature', value : 'auto',
description: 'netmap network backend support')
option('pixman', type : 'feature', value : 'auto',
description: 'pixman support')
option('slirp', type: 'feature', value: 'auto',
description: 'libslirp user mode network backend support')
option('vde', type : 'feature', value : 'auto',
Expand Down
3 changes: 3 additions & 0 deletions scripts/meson-buildoptions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ meson_options_help() {
printf "%s\n" ' pa PulseAudio sound support'
printf "%s\n" ' parallels parallels image format support'
printf "%s\n" ' pipewire PipeWire sound support'
printf "%s\n" ' pixman pixman support'
printf "%s\n" ' plugins TCG plugins via shared library loading'
printf "%s\n" ' png PNG support with libpng'
printf "%s\n" ' pvrdma Enable PVRDMA support'
Expand Down Expand Up @@ -419,6 +420,8 @@ _meson_option_parse() {
--disable-parallels) printf "%s" -Dparallels=disabled ;;
--enable-pipewire) printf "%s" -Dpipewire=enabled ;;
--disable-pipewire) printf "%s" -Dpipewire=disabled ;;
--enable-pixman) printf "%s" -Dpixman=enabled ;;
--disable-pixman) printf "%s" -Dpixman=disabled ;;
--with-pkgversion=*) quote_sh "-Dpkgversion=$2" ;;
--enable-plugins) printf "%s" -Dplugins=true ;;
--disable-plugins) printf "%s" -Dplugins=false ;;
Expand Down

0 comments on commit cca1575

Please sign in to comment.