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