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