xref: /openbmc/qemu/ui/meson.build (revision 3d558330)
1softmmu_ss.add(pixman)
2specific_ss.add(when: ['CONFIG_SOFTMMU'], if_true: pixman)   # for the include path
3specific_ss.add(when: ['CONFIG_SOFTMMU'], if_true: opengl)   # for the include path
4
5softmmu_ss.add(png)
6softmmu_ss.add(files(
7  'clipboard.c',
8  'console.c',
9  'cursor.c',
10  'input-keymap.c',
11  'input-legacy.c',
12  'input-barrier.c',
13  'input.c',
14  'kbd-state.c',
15  'keymaps.c',
16  'qemu-pixman.c',
17  'util.c',
18))
19if dbus_display
20  softmmu_ss.add(files('dbus-module.c'))
21endif
22softmmu_ss.add([spice_headers, files('spice-module.c')])
23softmmu_ss.add(when: spice_protocol, if_true: files('vdagent.c'))
24
25softmmu_ss.add(when: 'CONFIG_LINUX', if_true: files(
26  'input-linux.c',
27  'udmabuf.c',
28))
29softmmu_ss.add(when: cocoa, if_true: files('cocoa.m'))
30
31vnc_ss = ss.source_set()
32vnc_ss.add(files(
33  'vnc.c',
34  'vnc-enc-zlib.c',
35  'vnc-enc-hextile.c',
36  'vnc-enc-tight.c',
37  'vnc-palette.c',
38  'vnc-enc-zrle.c',
39  'vnc-auth-vencrypt.c',
40  'vnc-ws.c',
41  'vnc-jobs.c',
42  'vnc-clipboard.c',
43))
44vnc_ss.add(zlib, jpeg, gnutls)
45vnc_ss.add(when: sasl, if_true: files('vnc-auth-sasl.c'))
46softmmu_ss.add_all(when: vnc, if_true: vnc_ss)
47softmmu_ss.add(when: vnc, if_false: files('vnc-stubs.c'))
48
49ui_modules = {}
50
51if curses.found()
52  curses_ss = ss.source_set()
53  curses_ss.add(when: [curses, iconv], if_true: [files('curses.c'), pixman])
54  ui_modules += {'curses' : curses_ss}
55endif
56
57softmmu_ss.add(opengl)
58if opengl.found()
59  opengl_ss = ss.source_set()
60  opengl_ss.add(gbm)
61  opengl_ss.add(when: [opengl, pixman],
62               if_true: files('shader.c', 'console-gl.c', 'egl-helpers.c', 'egl-context.c'))
63  ui_modules += {'opengl' : opengl_ss}
64endif
65
66if opengl.found() and gbm.found()
67  egl_headless_ss = ss.source_set()
68  egl_headless_ss.add(when: [opengl, gbm, pixman],
69                      if_true: files('egl-headless.c'))
70  ui_modules += {'egl-headless' : egl_headless_ss}
71endif
72
73if dbus_display
74  dbus_ss = ss.source_set()
75  dbus_display1 = custom_target('dbus-display gdbus-codegen',
76                                output: ['dbus-display1.h', 'dbus-display1.c'],
77                                input: files('dbus-display1.xml'),
78                                command: [gdbus_codegen, '@INPUT@',
79                                          '--glib-min-required', '2.64',
80                                          '--output-directory', meson.current_build_dir(),
81                                          '--interface-prefix', 'org.qemu.',
82                                          '--c-namespace', 'QemuDBus',
83                                          '--generate-c-code', '@BASENAME@'])
84  dbus_ss.add(when: [gio, pixman, opengl, gbm],
85              if_true: [files(
86                'dbus-chardev.c',
87                'dbus-clipboard.c',
88                'dbus-console.c',
89                'dbus-error.c',
90                'dbus-listener.c',
91                'dbus.c',
92              ), dbus_display1])
93  ui_modules += {'dbus' : dbus_ss}
94endif
95
96if gtk.found()
97  softmmu_ss.add(when: 'CONFIG_WIN32', if_true: files('win32-kbd-hook.c'))
98
99  gtk_ss = ss.source_set()
100  gtk_ss.add(gtk, vte, pixman, files('gtk.c'))
101  if have_gtk_clipboard
102    gtk_ss.add(files('gtk-clipboard.c'))
103  endif
104  gtk_ss.add(when: x11, if_true: files('x_keymap.c'))
105  gtk_ss.add(when: opengl, if_true: files('gtk-gl-area.c'))
106  gtk_ss.add(when: [x11, opengl], if_true: files('gtk-egl.c'))
107  ui_modules += {'gtk' : gtk_ss}
108endif
109
110if sdl.found()
111  softmmu_ss.add(when: 'CONFIG_WIN32', if_true: files('win32-kbd-hook.c'))
112
113  sdl_ss = ss.source_set()
114  sdl_ss.add(sdl, sdl_image, pixman, glib, files(
115    'sdl2-2d.c',
116    'sdl2-input.c',
117    'sdl2.c',
118  ))
119  sdl_ss.add(when: opengl, if_true: files('sdl2-gl.c'))
120  sdl_ss.add(when: x11, if_true: files('x_keymap.c'))
121  ui_modules += {'sdl' : sdl_ss}
122endif
123
124if spice.found()
125  spice_core_ss = ss.source_set()
126  spice_core_ss.add(spice, pixman, files(
127    'spice-core.c',
128    'spice-input.c',
129    'spice-display.c'
130  ))
131  ui_modules += {'spice-core' : spice_core_ss}
132endif
133
134if spice.found() and gio.found()
135  spice_ss = ss.source_set()
136  spice_ss.add(spice, gio, pixman, files('spice-app.c'))
137  ui_modules += {'spice-app': spice_ss}
138endif
139
140keymaps = [
141  ['atset1', 'qcode'],
142  ['linux', 'qcode'],
143  ['qcode', 'atset1'],
144  ['qcode', 'atset2'],
145  ['qcode', 'atset3'],
146  ['qcode', 'linux'],
147  ['qcode', 'qnum'],
148  ['qcode', 'sun'],
149  ['qnum', 'qcode'],
150  ['usb', 'qcode'],
151  ['win32', 'qcode'],
152  ['x11', 'qcode'],
153  ['xorgevdev', 'qcode'],
154  ['xorgkbd', 'qcode'],
155  ['xorgxquartz', 'qcode'],
156  ['xorgxwin', 'qcode'],
157  ['osx', 'qcode'],
158]
159
160if have_system or xkbcommon.found()
161  foreach e : keymaps
162    output = 'input-keymap-@0@-to-@1@.c.inc'.format(e[0], e[1])
163    genh += custom_target(output,
164                  output: output,
165                  capture: true,
166                  input: files('keycodemapdb/data/keymaps.csv'),
167                  command: [python, files('keycodemapdb/tools/keymap-gen'),
168                            'code-map',
169                            '--lang', 'glib2',
170                            '--varname', 'qemu_input_map_@0@_to_@1@'.format(e[0], e[1]),
171                            '@INPUT0@', e[0], e[1]])
172  endforeach
173endif
174
175subdir('shader')
176
177if have_system
178  subdir('icons')
179
180  install_data('qemu.desktop', install_dir: qemu_desktopdir)
181endif
182
183modules += {'ui': ui_modules}
184