xref: /openbmc/qemu/ui/meson.build (revision 69430111)
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)
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 config_host.has_key('CONFIG_GTK')
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, 'CONFIG_X11'], if_true: files('x_keymap.c'))
66  gtk_ss.add(when: [opengl, 'CONFIG_OPENGL'], if_true: files('gtk-egl.c'))
67  gtk_ss.add(when: [opengl, 'CONFIG_GTK_GL'], if_true: files('gtk-gl-area.c'))
68  ui_modules += {'gtk' : gtk_ss}
69endif
70
71if sdl.found()
72  softmmu_ss.add(when: 'CONFIG_WIN32', if_true: files('win32-kbd-hook.c'))
73
74  sdl_ss = ss.source_set()
75  sdl_ss.add(sdl, sdl_image, pixman, glib, files(
76    'sdl2-2d.c',
77    'sdl2-input.c',
78    'sdl2.c',
79  ))
80  sdl_ss.add(when: [opengl, 'CONFIG_OPENGL'], if_true: files('sdl2-gl.c'))
81  sdl_ss.add(when: [x11, 'CONFIG_X11'], if_true: files('x_keymap.c'))
82  ui_modules += {'sdl' : sdl_ss}
83endif
84
85if config_host.has_key('CONFIG_SPICE')
86  spice_core_ss = ss.source_set()
87  spice_core_ss.add(spice, pixman, files(
88    'spice-core.c',
89    'spice-input.c',
90    'spice-display.c'
91  ))
92  ui_modules += {'spice-core' : spice_core_ss}
93endif
94
95if config_host.has_key('CONFIG_SPICE') and config_host.has_key('CONFIG_GIO')
96  spice_ss = ss.source_set()
97  spice_ss.add(spice, gio, pixman, files('spice-app.c'))
98  ui_modules += {'spice-app': spice_ss}
99endif
100
101keymap_gen = find_program('keycodemapdb/tools/keymap-gen')
102
103keymaps = [
104  ['atset1', 'qcode'],
105  ['linux', 'qcode'],
106  ['qcode', 'atset1'],
107  ['qcode', 'atset2'],
108  ['qcode', 'atset3'],
109  ['qcode', 'linux'],
110  ['qcode', 'qnum'],
111  ['qcode', 'sun'],
112  ['qnum', 'qcode'],
113  ['usb', 'qcode'],
114  ['win32', 'qcode'],
115  ['x11', 'qcode'],
116  ['xorgevdev', 'qcode'],
117  ['xorgkbd', 'qcode'],
118  ['xorgxquartz', 'qcode'],
119  ['xorgxwin', 'qcode'],
120  ['osx', 'qcode'],
121]
122
123if have_system or xkbcommon.found()
124  foreach e : keymaps
125    output = 'input-keymap-@0@-to-@1@.c.inc'.format(e[0], e[1])
126    genh += custom_target(output,
127                  output: output,
128                  capture: true,
129                  input: files('keycodemapdb/data/keymaps.csv'),
130                  command: [python.full_path(), files('keycodemapdb/tools/keymap-gen'),
131                            '--lang', 'glib2',
132                            '--varname', 'qemu_input_map_@0@_to_@1@'.format(e[0], e[1]),
133                            'code-map', '@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: config_host['qemu_desktopdir'])
143endif
144
145modules += {'ui': ui_modules}
146