xref: /openbmc/qemu/ui/meson.build (revision 041c2a31)
1softmmu_ss.add(pixman)
2specific_ss.add(when: ['CONFIG_SOFTMMU'], if_true: pixman)   # for the include path
3
4softmmu_ss.add(files(
5  'console.c',
6  'cursor.c',
7  'input-keymap.c',
8  'input-legacy.c',
9  'input-barrier.c',
10  'input.c',
11  'kbd-state.c',
12  'keymaps.c',
13  'qemu-pixman.c',
14))
15softmmu_ss.add([spice_headers, files('spice-module.c')])
16
17softmmu_ss.add(when: 'CONFIG_LINUX', if_true: files('input-linux.c'))
18softmmu_ss.add(when: cocoa, if_true: files('cocoa.m'))
19
20vnc_ss = ss.source_set()
21vnc_ss.add(files(
22  'vnc.c',
23  'vnc-enc-zlib.c',
24  'vnc-enc-hextile.c',
25  'vnc-enc-tight.c',
26  'vnc-palette.c',
27  'vnc-enc-zrle.c',
28  'vnc-auth-vencrypt.c',
29  'vnc-ws.c',
30  'vnc-jobs.c',
31))
32vnc_ss.add(zlib, png, jpeg, gnutls)
33vnc_ss.add(when: sasl, if_true: files('vnc-auth-sasl.c'))
34softmmu_ss.add_all(when: vnc, if_true: vnc_ss)
35softmmu_ss.add(when: vnc, if_false: files('vnc-stubs.c'))
36specific_ss.add(when: ['CONFIG_SOFTMMU'], if_true: opengl)
37
38ui_modules = {}
39
40if curses.found()
41  curses_ss = ss.source_set()
42  curses_ss.add(when: [curses, iconv], if_true: [files('curses.c'), pixman])
43  ui_modules += {'curses' : curses_ss}
44endif
45
46if config_host.has_key('CONFIG_OPENGL')
47  opengl_ss = ss.source_set()
48  opengl_ss.add(when: [opengl, pixman, 'CONFIG_OPENGL'],
49               if_true: files('shader.c', 'console-gl.c', 'egl-helpers.c', 'egl-context.c'))
50  ui_modules += {'opengl' : opengl_ss}
51endif
52
53if config_host.has_key('CONFIG_OPENGL_DMABUF')
54  egl_headless_ss = ss.source_set()
55  egl_headless_ss.add(when: [opengl, pixman, 'CONFIG_OPENGL_DMABUF'],
56                      if_true: files('egl-headless.c'))
57  ui_modules += {'egl-headless' : egl_headless_ss}
58endif
59
60if gtk.found()
61  softmmu_ss.add(when: 'CONFIG_WIN32', if_true: files('win32-kbd-hook.c'))
62
63  gtk_ss = ss.source_set()
64  gtk_ss.add(gtk, vte, pixman, files('gtk.c'))
65  gtk_ss.add(when: x11, if_true: files('x_keymap.c'))
66  gtk_ss.add(when: [opengl, 'CONFIG_OPENGL'], if_true: files('gtk-egl.c', 'gtk-gl-area.c'))
67  ui_modules += {'gtk' : gtk_ss}
68endif
69
70if sdl.found()
71  softmmu_ss.add(when: 'CONFIG_WIN32', if_true: files('win32-kbd-hook.c'))
72
73  sdl_ss = ss.source_set()
74  sdl_ss.add(sdl, sdl_image, pixman, glib, files(
75    'sdl2-2d.c',
76    'sdl2-input.c',
77    'sdl2.c',
78  ))
79  sdl_ss.add(when: [opengl, 'CONFIG_OPENGL'], if_true: files('sdl2-gl.c'))
80  sdl_ss.add(when: x11, if_true: files('x_keymap.c'))
81  ui_modules += {'sdl' : sdl_ss}
82endif
83
84if config_host.has_key('CONFIG_SPICE')
85  spice_core_ss = ss.source_set()
86  spice_core_ss.add(spice, pixman, files(
87    'spice-core.c',
88    'spice-input.c',
89    'spice-display.c'
90  ))
91  ui_modules += {'spice-core' : spice_core_ss}
92endif
93
94if config_host.has_key('CONFIG_SPICE') and config_host.has_key('CONFIG_GIO')
95  spice_ss = ss.source_set()
96  spice_ss.add(spice, gio, pixman, files('spice-app.c'))
97  ui_modules += {'spice-app': spice_ss}
98endif
99
100keymap_gen = find_program('keycodemapdb/tools/keymap-gen')
101
102keymaps = [
103  ['atset1', 'qcode'],
104  ['linux', 'qcode'],
105  ['qcode', 'atset1'],
106  ['qcode', 'atset2'],
107  ['qcode', 'atset3'],
108  ['qcode', 'linux'],
109  ['qcode', 'qnum'],
110  ['qcode', 'sun'],
111  ['qnum', 'qcode'],
112  ['usb', 'qcode'],
113  ['win32', 'qcode'],
114  ['x11', 'qcode'],
115  ['xorgevdev', 'qcode'],
116  ['xorgkbd', 'qcode'],
117  ['xorgxquartz', 'qcode'],
118  ['xorgxwin', 'qcode'],
119  ['osx', 'qcode'],
120]
121
122if have_system or xkbcommon.found()
123  foreach e : keymaps
124    output = 'input-keymap-@0@-to-@1@.c.inc'.format(e[0], e[1])
125    genh += custom_target(output,
126                  output: output,
127                  capture: true,
128                  input: files('keycodemapdb/data/keymaps.csv'),
129                  command: [python.full_path(), files('keycodemapdb/tools/keymap-gen'),
130                            'code-map',
131                            '--lang', 'glib2',
132                            '--varname', 'qemu_input_map_@0@_to_@1@'.format(e[0], e[1]),
133                            '@INPUT0@', e[0], e[1]])
134  endforeach
135endif
136
137subdir('shader')
138
139if have_system
140  subdir('icons')
141
142  install_data('qemu.desktop', install_dir: qemu_desktopdir)
143endif
144
145modules += {'ui': ui_modules}
146