meson.build revision 452262e1
1# Copyright © 2018 Intel Corporation
2
3# Permission is hereby granted, free of charge, to any person obtaining a copy
4# of this software and associated documentation files (the "Software"), to deal
5# in the Software without restriction, including without limitation the rights
6# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7# copies of the Software, and to permit persons to whom the Software is
8# furnished to do so, subject to the following conditions:
9
10# The above copyright notice and this permission notice shall be included in
11# all copies or substantial portions of the Software.
12
13# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19# SOFTWARE.
20
21# keep version in sync with configure.ac
22project('xorgproto', 'c', license : 'MIT', version : '2022.2')
23cc = meson.get_compiler('c')
24
25pcs = [
26        'applewmproto',
27        'bigreqsproto',
28        'compositeproto',
29        'damageproto',
30        'dmxproto',
31        'dpmsproto',
32        'dri2proto',
33        'dri3proto',
34        'fixesproto',
35        'fontsproto',
36        'glproto',
37        'inputproto',
38        'kbproto',
39        'presentproto',
40        'randrproto',
41        'recordproto',
42        'renderproto',
43        'resourceproto',
44        'scrnsaverproto',
45        'videoproto',
46        'xcmiscproto',
47        'xextproto',
48        'xf86bigfontproto',
49        'xf86dgaproto',
50        'xf86driproto',
51        'xf86vidmodeproto',
52        'xineramaproto',
53        'xproto',
54        'xwaylandproto',
55]
56
57pc_data = configuration_data()
58pc_data.set('prefix', get_option('prefix'))
59# meson does not allow installing the includedir outside of the prefix
60pc_data.set('includedir', '${prefix}/' + get_option('includedir'))
61
62foreach pc : pcs
63    configure_file(
64        input : pc + '.pc.in',
65        output : pc + '.pc',
66        install_dir : get_option('datadir') + '/pkgconfig',
67        configuration : pc_data,
68    )
69endforeach
70
71
72docs = files('compositeproto.txt',
73             'damageproto.txt',
74             'dri2proto.txt',
75             'dri3proto.txt',
76             'fixesproto.txt',
77             'PM_spec',
78             'presentproto.txt',
79             'randrproto.txt',
80             'renderproto.txt',
81             'resproto.txt',
82             'xv-protocol-v2.txt',
83             'xwaylandproto.txt')
84install_data(docs,
85             install_dir: get_option('datadir') / 'doc' / 'xorgproto')
86
87
88if get_option('legacy') == true
89    legacy_pcs = [
90        'evieproto',
91        'fontcacheproto',
92        'lg3dproto',
93        'printproto',
94        'trapproto',
95        'windowswmproto',
96        'xcalibrateproto',
97        'xf86miscproto',
98        'xf86rushproto',
99        'xproxymngproto',
100    ]
101    foreach pc : legacy_pcs
102        configure_file(
103            input : pc + '.pc.in',
104            output : pc + '.pc',
105            install_dir : get_option('datadir') + '/pkgconfig',
106            configuration : pc_data,
107        )
108    endforeach
109endif
110
111ext_xorgproto = declare_dependency(
112    include_directories : include_directories('include')
113)
114
115subdir('include')
116
117keysymfile = join_paths(meson.source_root(), 'include', 'X11', 'XF86keysym.h')
118test('evdev-keysym-check',
119     find_program('scripts/keysym-generator.py'),
120     args: ['-v', '--header', keysymfile, 'verify'])
121