meson.build revision d63b911f
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
21project('xorgproto', 'c', license : 'MIT', version : '2021.3')
22cc = meson.get_compiler('c')
23sed = find_program('sed')
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]
55
56pc_data = configuration_data()
57pc_data.set('prefix', get_option('prefix'))
58# meson does not allow installing the includedir outside of the prefix
59pc_data.set('includedir', '${prefix}/' + get_option('includedir'))
60
61foreach pc : pcs
62    configure_file(
63        input : pc + '.pc.in',
64        output : pc + '.pc',
65        install_dir : get_option('datadir') + '/pkgconfig',
66        configuration : pc_data,
67    )
68endforeach
69
70if get_option('legacy') == true
71    legacy_pcs = [
72        'evieproto',
73        'fontcacheproto',
74        'lg3dproto',
75        'printproto',
76        'trapproto',
77        'windowswmproto',
78        'xcalibrateproto',
79        'xf86miscproto',
80        'xf86rushproto',
81        'xproxymngproto',
82    ]
83    foreach pc : legacy_pcs
84        configure_file(
85            input : pc + '.pc.in',
86            output : pc + '.pc',
87            install_dir : get_option('datadir') + '/pkgconfig',
88            configuration : pc_data,
89        )
90    endforeach
91endif
92
93ext_xorgproto = declare_dependency(
94    include_directories : include_directories('include')
95)
96
97subdir('include')
98
99keysymfile = join_paths(meson.source_root(), 'include', 'X11', 'XF86keysym.h')
100test('evdev-keysym-check',
101     find_program('scripts/keysym-generator.py'),
102     args: ['-v', '--header', keysymfile, 'verify'])
103