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