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