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