meson.build 4.14 KB
Newer Older
1 2 3
srcs = [
    'xwayland.c',
    'xwayland-input.c',
4
    'xwayland-input.h',
5
    'xwayland-cursor.c',
6
    'xwayland-cursor.h',
7
    'xwayland-glamor.h',
8
    'xwayland-glx.h',
9 10
    'xwayland-pixmap.c',
    'xwayland-pixmap.h',
11
    'xwayland-present.h',
12 13
    'xwayland-screen.c',
    'xwayland-screen.h',
14
    'xwayland-shm.c',
15
    'xwayland-shm.h',
16
    'xwayland-types.h',
17
    'xwayland-output.c',
18
    'xwayland-output.h',
19
    'xwayland-cvt.c',
20
    'xwayland-cvt.h',
21
    'xwayland-vidmode.c',
22
    'xwayland-vidmode.h',
23 24
    'xwayland-window.c',
    'xwayland-window.h',
25 26
    'xwayland-window-buffers.c',
    'xwayland-window-buffers.h',
27 28 29 30 31 32
    '../../mi/miinitext.c',
]

scanner_dep = dependency('wayland-scanner', native: true)
scanner = find_program(scanner_dep.get_pkgconfig_variable('wayland_scanner'))

33
protocols_dep = dependency('wayland-protocols', version: wayland_protocols_req)
34 35 36 37
protodir = protocols_dep.get_pkgconfig_variable('pkgdatadir')

pointer_xml = join_paths(protodir, 'unstable', 'pointer-constraints', 'pointer-constraints-unstable-v1.xml')
relative_xml = join_paths(protodir, 'unstable', 'relative-pointer', 'relative-pointer-unstable-v1.xml')
38
tablet_xml = join_paths(protodir, 'unstable', 'tablet', 'tablet-unstable-v2.xml')
39
kbgrab_xml = join_paths(protodir, 'unstable', 'xwayland-keyboard-grab', 'xwayland-keyboard-grab-unstable-v1.xml')
40
xdg_output_xml = join_paths(protodir, 'unstable', 'xdg-output', 'xdg-output-unstable-v1.xml')
41
dmabuf_xml = join_paths(protodir, 'unstable', 'linux-dmabuf', 'linux-dmabuf-unstable-v1.xml')
42
viewporter_xml = join_paths(protodir, 'stable', 'viewporter', 'viewporter.xml')
43
xdg_shell_xml = join_paths(protodir, 'stable', 'xdg-shell', 'xdg-shell.xml')
44 45 46 47 48

client_header = generator(scanner,
    output : '@BASENAME@-client-protocol.h',
    arguments : ['client-header', '@INPUT@', '@OUTPUT@']
)
49 50 51 52 53 54 55

if scanner_dep.version().version_compare('>= 1.14.91')
    scanner_argument = 'private-code'
else
    scanner_argument = 'code'
endif

56 57
code = generator(scanner,
    output : '@BASENAME@-protocol.c',
58
    arguments : [scanner_argument, '@INPUT@', '@OUTPUT@']
59 60 61
)
srcs += client_header.process(relative_xml)
srcs += client_header.process(pointer_xml)
62
srcs += client_header.process(tablet_xml)
63
srcs += client_header.process(kbgrab_xml)
64
srcs += client_header.process(xdg_output_xml)
65
srcs += client_header.process(dmabuf_xml)
66
srcs += client_header.process(viewporter_xml)
67
srcs += client_header.process(xdg_shell_xml)
68 69
srcs += code.process(relative_xml)
srcs += code.process(pointer_xml)
70
srcs += code.process(tablet_xml)
71
srcs += code.process(kbgrab_xml)
72
srcs += code.process(xdg_output_xml)
73
srcs += code.process(dmabuf_xml)
74
srcs += code.process(viewporter_xml)
75
srcs += code.process(xdg_shell_xml)
76 77

xwayland_glamor = []
78 79 80
eglstream_srcs = []
if build_glamor
    srcs += 'xwayland-glamor.c'
81 82 83
    if build_glx
        srcs += 'xwayland-glx.c'
    endif
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
    if gbm_dep.found()
        srcs += 'xwayland-glamor-gbm.c'
    endif
    if build_eglstream
        eglstream_protodir = eglstream_dep.get_pkgconfig_variable('pkgdatadir')
        eglstream_xml = join_paths(eglstream_protodir, 'wayland-eglstream.xml')
        eglstream_controller_xml = join_paths(eglstream_protodir, 'wayland-eglstream-controller.xml')

        srcs += client_header.process(eglstream_xml)
        srcs += client_header.process(eglstream_controller_xml)
        srcs += code.process(eglstream_xml)
        srcs += code.process(eglstream_controller_xml)

        srcs += 'xwayland-glamor-eglstream.c'
    endif
    srcs += 'xwayland-present.c'
100 101 102 103 104 105 106 107 108 109
    if build_xv
        srcs += 'xwayland-glamor-xv.c'
    endif

    srcs += client_header.process('drm.xml')
    srcs += code.process('drm.xml')
    xwayland_dep += gbm_dep
    xwayland_glamor += glamor
endif

110 111 112 113 114
wayland_inc = [ inc, ]
if build_glx
    wayland_inc += glx_inc
endif

115 116 117
executable(
    'Xwayland',
    srcs,
118
    include_directories: wayland_inc,
119 120 121 122 123 124 125 126 127 128 129 130 131
    dependencies: [
        common_dep,
        xwayland_dep,
    ],
    link_with: [
        libxserver_main,
        xwayland_glamor,
        libxserver_fb,
        libxserver,
        libxserver_xext_vidmode,
        libxserver_xkb_stubs,
        libxserver_xi_stubs,
        libxserver_glx,
132
        libglxvnd,
133 134 135
    ],
    install: true,
)