aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2019-07-16 23:21:02 +0400
committerPaolo Bonzini <pbonzini@redhat.com>2020-08-21 06:30:21 -0400
commit2b1ccdf44146424032e384749efa993855f3bda6 (patch)
tree13bf396441fb7b12e88fa501ec8973ab8ec0812f /ui
parent478e943f515bffb712ff65a85b5db36c90a2f5e7 (diff)
meson: convert ui directory to Meson
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/Makefile.objs73
-rw-r--r--ui/meson.build82
-rw-r--r--ui/shader.c6
3 files changed, 84 insertions, 77 deletions
diff --git a/ui/Makefile.objs b/ui/Makefile.objs
deleted file mode 100644
index 504b196479..0000000000
--- a/ui/Makefile.objs
+++ /dev/null
@@ -1,73 +0,0 @@
-vnc-obj-y += vnc.o
-vnc-obj-y += vnc-enc-zlib.o vnc-enc-hextile.o
-vnc-obj-y += vnc-enc-tight.o vnc-palette.o
-vnc-obj-y += vnc-enc-zrle.o
-vnc-obj-y += vnc-auth-vencrypt.o
-vnc-obj-$(CONFIG_VNC_SASL) += vnc-auth-sasl.o
-vnc-obj-y += vnc-ws.o
-vnc-obj-y += vnc-jobs.o
-
-common-obj-y += keymaps.o console.o cursor.o qemu-pixman.o
-common-obj-y += input.o input-keymap.o input-legacy.o kbd-state.o
-common-obj-y += input-barrier.o
-common-obj-$(CONFIG_LINUX) += input-linux.o
-common-obj-$(CONFIG_SPICE) += spice-core.o spice-input.o spice-display.o
-common-obj-$(CONFIG_COCOA) += cocoa.o
-common-obj-$(CONFIG_VNC) += $(vnc-obj-y)
-common-obj-$(call lnot,$(CONFIG_VNC)) += vnc-stubs.o
-ifneq (,$(findstring m,$(CONFIG_SDL)$(CONFIG_GTK)))
-common-obj-$(CONFIG_WIN32) += win32-kbd-hook.o
-endif
-
-# ui-sdl module
-common-obj-$(CONFIG_SDL) += sdl.mo
-sdl.mo-objs := sdl2.o sdl2-input.o sdl2-2d.o
-ifeq ($(CONFIG_OPENGL),y)
-sdl.mo-objs += sdl2-gl.o
-endif
-sdl.mo-cflags := $(SDL_CFLAGS)
-sdl.mo-libs := $(SDL_LIBS)
-
-# ui-gtk module
-common-obj-$(CONFIG_GTK) += gtk.mo
-gtk.mo-objs := gtk.o
-gtk.mo-cflags := $(GTK_CFLAGS) $(VTE_CFLAGS)
-gtk.mo-libs := $(GTK_LIBS) $(VTE_LIBS)
-ifeq ($(CONFIG_OPENGL),y)
-gtk.mo-objs += gtk-egl.o
-gtk.mo-libs += $(OPENGL_LIBS)
-ifeq ($(CONFIG_GTK_GL),y)
-gtk.mo-objs += gtk-gl-area.o
-endif
-endif
-
-ifeq ($(CONFIG_X11),y)
-sdl.mo-objs += x_keymap.o
-gtk.mo-objs += x_keymap.o
-x_keymap.o-cflags := $(X11_CFLAGS)
-x_keymap.o-libs := $(X11_LIBS)
-endif
-
-common-obj-$(CONFIG_CURSES) += curses.mo
-curses.mo-objs := curses.o
-curses.mo-cflags := $(CURSES_CFLAGS) $(ICONV_CFLAGS)
-curses.mo-libs := $(CURSES_LIBS) $(ICONV_LIBS)
-
-ifeq ($(CONFIG_GIO)$(CONFIG_SPICE),yy)
-common-obj-$(if $(CONFIG_MODULES),m,y) += spice-app.mo
-endif
-spice-app.mo-objs := spice-app.o
-spice-app.mo-cflags := $(GIO_CFLAGS)
-spice-app.mo-libs := $(GIO_LIBS)
-
-common-obj-$(CONFIG_OPENGL) += shader.o
-common-obj-$(CONFIG_OPENGL) += console-gl.o
-common-obj-$(CONFIG_OPENGL) += egl-helpers.o
-common-obj-$(CONFIG_OPENGL) += egl-context.o
-common-obj-$(CONFIG_OPENGL_DMABUF) += egl-headless.o
-
-shader.o-libs += $(OPENGL_LIBS)
-console-gl.o-libs += $(OPENGL_LIBS)
-egl-helpers.o-libs += $(OPENGL_LIBS)
-egl-context.o-libs += $(OPENGL_LIBS)
-egl-headless.o-libs += $(OPENGL_LIBS)
diff --git a/ui/meson.build b/ui/meson.build
index 35da0d8d26..66282c398d 100644
--- a/ui/meson.build
+++ b/ui/meson.build
@@ -1,3 +1,82 @@
+softmmu_ss.add(files(
+ 'console.c',
+ 'cursor.c',
+ 'input-keymap.c',
+ 'input-legacy.c',
+ 'input-barrier.c',
+ 'input.c',
+ 'kbd-state.c',
+ 'keymaps.c',
+ 'qemu-pixman.c',
+))
+softmmu_ss.add(pixman)
+
+softmmu_ss.add(when: 'CONFIG_LINUX', if_true: files('input-linux.c'))
+softmmu_ss.add(when: 'CONFIG_SPICE', if_true: files('spice-core.c', 'spice-input.c', 'spice-display.c'))
+softmmu_ss.add(when: [cocoa, 'CONFIG_COCOA'], if_true: files('cocoa.m'))
+
+vnc_ss = ss.source_set()
+vnc_ss.add(files(
+ 'vnc.c',
+ 'vnc-enc-zlib.c',
+ 'vnc-enc-hextile.c',
+ 'vnc-enc-tight.c',
+ 'vnc-palette.c',
+ 'vnc-enc-zrle.c',
+ 'vnc-auth-vencrypt.c',
+ 'vnc-ws.c',
+ 'vnc-jobs.c',
+))
+vnc_ss.add(zlib)
+vnc_ss.add(when: 'CONFIG_VNC_SASL', if_true: [files('vnc-auth-sasl.c'), sasl])
+softmmu_ss.add_all(when: 'CONFIG_VNC', if_true: vnc_ss)
+softmmu_ss.add(when: 'CONFIG_VNC', if_false: files('vnc-stubs.c'))
+softmmu_ss.add(when: [opengl, 'CONFIG_OPENGL'], if_true: files('shader.c', 'console-gl.c', 'egl-helpers.c', 'egl-context.c'))
+softmmu_ss.add(when: [opengl, 'CONFIG_OPENGL_DMABUF'], if_true: files('egl-headless.c'))
+softmmu_ss.add(when: 'CONFIG_VNC_PNG', if_true: png)
+softmmu_ss.add(when: 'CONFIG_VNC_JPEG', if_true: jpeg)
+
+ui_modules = {}
+
+if config_host.has_key('CONFIG_CURSES')
+ curses_ss = ss.source_set()
+ curses_ss.add(when: [curses, iconv], if_true: files('curses.c'))
+ ui_modules += {'curses' : curses_ss}
+endif
+
+if config_host.has_key('CONFIG_GTK') and config_host.has_key('CONFIG_VTE')
+ softmmu_ss.add(when: 'CONFIG_WIN32', if_true: files('win32-kbd-hook.c'))
+
+ gtk_ss = ss.source_set()
+ gtk_ss.add(gtk, vte, files('gtk.c'))
+ gtk_ss.add(when: [x11, 'CONFIG_X11'], if_true: files('x_keymap.c'))
+ gtk_ss.add(when: [opengl, 'CONFIG_OPENGL'], if_true: files('gtk-egl.c'))
+ gtk_ss.add(when: [opengl, 'CONFIG_GTK_GL'], if_true: files('gtk-gl-area.c'))
+ ui_modules += {'gtk' : gtk_ss}
+endif
+
+if config_host.has_key('CONFIG_SDL')
+ softmmu_ss.add(when: 'CONFIG_WIN32', if_true: files('win32-kbd-hook.c'))
+
+ sdl_ss = ss.source_set()
+ sdl_ss.add(pixman, glib, files(
+ 'sdl2-2d.c',
+ 'sdl2-input.c',
+ 'sdl2.c',
+ ))
+ sdl_ss.add(when: [opengl, 'CONFIG_OPENGL'], if_true: files('sdl2-gl.c'))
+ sdl_ss.add(when: [x11, 'CONFIG_X11'], if_true: files('x_keymap.c'))
+ ui_modules += {'sdl' : sdl_ss}
+endif
+
+if config_host.has_key('CONFIG_SPICE') and config_host.has_key('CONFIG_GIO')
+ spice_ss = ss.source_set()
+ spice_ss.add(spice, gio, files('spice-app.c'))
+ ui_modules += {'spice-app': spice_ss}
+endif
+
+keymap_gen = find_program('keycodemapdb/tools/keymap-gen')
+
keymaps = [
['atset1', 'qcode'],
['linux', 'qcode'],
@@ -24,7 +103,6 @@ if have_system
genh += custom_target(output,
output: output,
capture: true,
- build_by_default: true, # to be removed when added to a target
input: files('keycodemapdb/data/keymaps.csv'),
command: [python.full_path(), files('keycodemapdb/tools/keymap-gen'),
'--lang', 'glib2',
@@ -34,3 +112,5 @@ if have_system
endif
subdir('shader')
+
+modules += {'ui': ui_modules}
diff --git a/ui/shader.c b/ui/shader.c
index d78829f43b..e8b8d321b7 100644
--- a/ui/shader.c
+++ b/ui/shader.c
@@ -27,9 +27,9 @@
#include "qemu/osdep.h"
#include "ui/shader.h"
-#include "shader/texture-blit-vert.h"
-#include "shader/texture-blit-flip-vert.h"
-#include "shader/texture-blit-frag.h"
+#include "ui/shader/texture-blit-vert.h"
+#include "ui/shader/texture-blit-flip-vert.h"
+#include "ui/shader/texture-blit-frag.h"
struct QemuGLShader {
GLint texture_blit_prog;