Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mesa
Path: blob/21.2-virgl/src/compiler/glsl/glcpp/meson.build
4547 views
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
bison_command = []
22
if yacc_is_bison
23
bison_command = [
24
prog_bison, '-o', '@OUTPUT0@', '-p', 'glcpp_parser_',
25
'--defines=@OUTPUT1@', '@INPUT@',
26
]
27
else
28
bison_command = [
29
prog_bison, '-o', '@OUTPUT0@', '-p', 'glcpp_parser_',
30
'-H', '@OUTPUT1@', '@INPUT@',
31
]
32
endif
33
34
glcpp_parse = custom_target(
35
'glcpp-parse.[ch]',
36
input : 'glcpp-parse.y',
37
output : ['glcpp-parse.c', 'glcpp-parse.h'],
38
command : bison_command
39
)
40
41
glcpp_lex = custom_target(
42
'glcpp-lex.c',
43
input : 'glcpp-lex.l',
44
output : 'glcpp-lex.c',
45
command : [prog_flex, '-o', '@OUTPUT@', '@INPUT@'],
46
)
47
48
_extra_args = []
49
if cpp.get_id() == 'msvc'
50
# Flex relies on __STDC_VERSION__>=199901L to decide when to include C99
51
# inttypes.h. We always have inttypes.h available with MSVC (either the one
52
# bundled with MSVC 2013, or the one we bundle ourselves), but we can't just
53
# define __STDC_VERSION__ without breaking stuff, as MSVC doesn't fully
54
# support C99. There's also no way to premptively include stdint.
55
_extra_args += '-FIinttypes.h'
56
endif
57
58
libglcpp = static_library(
59
'glcpp',
60
[glcpp_lex, glcpp_parse, files('glcpp.h', 'pp.c')],
61
dependencies : idep_mesautil,
62
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
63
c_args : [no_override_init_args, c_msvc_compat_args, _extra_args],
64
cpp_args : [cpp_msvc_compat_args, _extra_args],
65
gnu_symbol_visibility : 'hidden',
66
build_by_default : false,
67
)
68
69
libglcpp_standalone = static_library(
70
'glcpp_standalone',
71
'pp_standalone_scaffolding.c',
72
link_with : libglcpp,
73
dependencies : idep_mesautil,
74
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
75
c_args : [no_override_init_args, c_msvc_compat_args, _extra_args],
76
cpp_args : [cpp_msvc_compat_args, _extra_args],
77
gnu_symbol_visibility : 'hidden',
78
build_by_default : false,
79
)
80
81
glcpp = executable(
82
'glcpp',
83
'glcpp.c',
84
dependencies : [dep_m, idep_getopt, idep_mesautil],
85
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
86
link_with : [libglcpp_standalone, libglsl_util],
87
c_args : [no_override_init_args, c_msvc_compat_args],
88
gnu_symbol_visibility : 'hidden',
89
build_by_default : false,
90
)
91
92
# FIXME: these fail on windows due to whitespace differences
93
if with_any_opengl and with_tests and host_machine.system() != 'windows'
94
modes = ['unix', 'windows', 'oldmac', 'bizarro']
95
96
foreach m : modes
97
test(
98
'glcpp test (@0@)'.format(m),
99
prog_python,
100
args : [
101
join_paths(meson.current_source_dir(), 'tests/glcpp_test.py'),
102
glcpp, join_paths(meson.current_source_dir(), 'tests'),
103
'--@0@'.format(m),
104
],
105
suite : ['compiler', 'glcpp'],
106
timeout: 60,
107
)
108
endforeach
109
110
if dep_valgrind.found()
111
test(
112
'glcpp test (valgrind)',
113
prog_python,
114
args : [
115
join_paths(meson.current_source_dir(), 'tests/glcpp_test.py'),
116
glcpp, join_paths(meson.current_source_dir(), 'tests'),
117
'--valgrind',
118
],
119
suite : ['compiler', 'glcpp'],
120
timeout: 240,
121
)
122
endif
123
endif
124
125