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