freedreno/registers: install gzip'd register database
[mesa.git] / src / freedreno / decode / meson.build
1 # Copyright © 2020 Google, Inc
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 dep_lua = dependency('lua53', required: false)
22 if not dep_lua.found()
23 dep_lua = dependency('lua52', required: false)
24 endif
25 if not dep_lua.found()
26 dep_lua = dependency('lua', required: false)
27 endif
28
29 dep_libarchive = dependency('libarchive', required: false)
30
31 # Shared cmdstream decoding:
32 libfreedreno_cffdec = static_library(
33 'freedreno_cffdec',
34 [
35 'buffers.c',
36 'buffers.h',
37 'cffdec.c',
38 'cffdec.h',
39 'pager.c',
40 'pager.h',
41 'rnnutil.c',
42 'rnnutil.h',
43 'util.h',
44 ],
45 include_directories: [
46 inc_freedreno,
47 inc_freedreno_rnn,
48 inc_include,
49 inc_src,
50 ],
51 c_args : [ no_override_init_args ],
52 gnu_symbol_visibility: 'hidden',
53 dependencies: [],
54 link_with: [
55 libfreedreno_rnn,
56 libfreedreno_ir2, # for disasm_a2xx
57 libfreedreno_ir3, # for disasm_a3xx
58 ],
59 build_by_default: false,
60 )
61
62 if dep_libarchive.found()
63 libfreedreno_io = static_library(
64 'libfreedreno_io',
65 [
66 'io.c',
67 'io.h',
68 ],
69 include_directories: [],
70 c_args : [no_override_init_args],
71 gnu_symbol_visibility: 'hidden',
72 dependencies: [
73 dep_libarchive,
74 ],
75 build_by_default: false,
76 )
77 endif
78
79 if dep_lua.found() and dep_libarchive.found()
80 cffdump = executable(
81 'cffdump',
82 [
83 'cffdump.c',
84 'script.c',
85 'script.h'
86 ],
87 include_directories: [
88 inc_freedreno,
89 inc_freedreno_rnn,
90 inc_include,
91 inc_src,
92 ],
93 c_args : [no_override_init_args],
94 gnu_symbol_visibility: 'hidden',
95 dependencies: [
96 dep_lua,
97 ],
98 link_with: [
99 libfreedreno_cffdec,
100 libfreedreno_io,
101 ],
102 build_by_default: with_tools.contains('freedreno'),
103 install: install_fd_decode_tools,
104 )
105 endif
106
107 crashdec = executable(
108 'crashdec',
109 'crashdec.c',
110 include_directories: [
111 inc_freedreno,
112 inc_freedreno_rnn,
113 inc_include,
114 inc_src,
115 ],
116 gnu_symbol_visibility: 'hidden',
117 dependencies: [],
118 link_with: [
119 libfreedreno_cffdec,
120 ],
121 build_by_default: with_tools.contains('freedreno'),
122 install: install_fd_decode_tools,
123 )
124
125 if dep_libarchive.found()
126 pgmdump = executable(
127 'pgmdump',
128 'pgmdump.c',
129 include_directories: [
130 inc_freedreno,
131 inc_include,
132 inc_src,
133 ],
134 gnu_symbol_visibility: 'hidden',
135 dependencies: [],
136 link_with: [
137 libfreedreno_cffdec,
138 libfreedreno_io,
139 libfreedreno_ir2, # for disasm_a2xx
140 libfreedreno_ir3, # for disasm_a3xx
141 ],
142 build_by_default: with_tools.contains('freedreno'),
143 install: false,
144 )
145 pgmdump2 = executable(
146 'pgmdump2',
147 'pgmdump2.c',
148 include_directories: [
149 inc_freedreno,
150 inc_include,
151 inc_src,
152 ],
153 gnu_symbol_visibility: 'hidden',
154 dependencies: [],
155 link_with: [
156 libfreedreno_cffdec,
157 libfreedreno_io,
158 libfreedreno_ir2, # for disasm_a2xx
159 libfreedreno_ir3, # for disasm_a3xx
160 ],
161 build_by_default: with_tools.contains('freedreno'),
162 install: false,
163 )
164 endif