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