meson: build glx
[mesa.git] / src / mapi / glapi / meson.build
1 # Copyright © 2017 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 inc_glapi = include_directories('.')
22
23 static_glapi_files = []
24 static_glapi_args = []
25
26 if with_appledri or with_windowsdri
27 static_glapi_files += files('glapi_gentable.c')
28 endif
29
30 if with_shared_glapi
31 static_glapi_files += files(
32 '../entry.c',
33 '../entry.h',
34 '../entry_x86-64_tls.h',
35 '../entry_x86_tls.h',
36 '../entry_x86_tsd.h',
37 '../entry_ppc64le_tls.h',
38 '../entry_ppc64le_tsd.h',
39 '../mapi_tmp.h',
40 )
41 static_glapi_files += glapi_mapi_tmp_h
42 static_glapi_args += [
43 '-DMAPI_MODE_BRIDGE',
44 '-DMAPI_ABI_HEADER="@0@"'.format(glapi_mapi_tmp_h.full_path()),
45 ]
46 else
47 static_glapi_args += '-DMAPI_MODE_UTIL'
48 static_glapi_files += files(
49 'glapi_dispatch.c',
50 'glapi_entrypoint.c',
51 'glapi_getproc.c',
52 'glapi_nop.c',
53 'glapi.c',
54 'glapi.h',
55 'glapi_priv.h',
56 )
57 static_glapi_files += files_mapi_util
58 if with_asm_arch == 'x86'
59 static_glapi_files += glapi_x86_s
60 elif with_asm_arch == 'x86_64'
61 static_glapi_files += glapi_x86_64_s
62 endif
63 # TODO: SPARC asm
64 endif
65
66 libglapi_static = static_library(
67 'glapi_static',
68 static_glapi_files,
69 include_directories : [inc_mesa, inc_include, inc_src],
70 c_args : [c_msvc_compat_args, static_glapi_args],
71 dependencies : [dep_thread, dep_selinux],
72 build_by_default : false,
73 )
74
75 if not with_shared_glapi and with_tests
76 glapi_static_check_table = executable(
77 'glapi_static_check_table',
78 'tests/check_table.cpp',
79 link_with : [libglapi_static],
80 dependencies : [idep_gtest],
81 )
82
83 test('glapi_static_check_table', glapi_static_check_table)
84 endif