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