freedreno: deduplicate a3xx+ disasm
[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 'disasm-a2xx.c',
40 'instr-a2xx.h',
41 'pager.c',
42 'pager.h',
43 'rnnutil.c',
44 'rnnutil.h',
45 'util.h',
46 ],
47 include_directories: [
48 inc_freedreno,
49 inc_freedreno_rnn,
50 inc_include,
51 inc_src,
52 ],
53 c_args : [ no_override_init_args ],
54 gnu_symbol_visibility: 'hidden',
55 dependencies: [],
56 link_with: [
57 libfreedreno_rnn,
58 libfreedreno_ir3, # for disasm_a3xx
59 ],
60 build_by_default: false,
61 )
62
63 if dep_libarchive.found()
64 libfreedreno_io = static_library(
65 'libfreedreno_io',
66 [
67 'io.c',
68 'io.h',
69 ],
70 include_directories: [],
71 c_args : [no_override_init_args],
72 gnu_symbol_visibility: 'hidden',
73 dependencies: [
74 dep_libarchive,
75 ],
76 build_by_default: false,
77 )
78 endif
79
80 if dep_lua.found() and dep_libarchive.found()
81 cffdump = executable(
82 'cffdump',
83 [
84 'cffdump.c',
85 'script.c',
86 'script.h'
87 ],
88 include_directories: [
89 inc_freedreno,
90 inc_freedreno_rnn,
91 inc_include,
92 inc_src,
93 ],
94 c_args : [no_override_init_args],
95 gnu_symbol_visibility: 'hidden',
96 dependencies: [
97 dep_lua,
98 ],
99 link_with: [
100 libfreedreno_cffdec,
101 libfreedreno_io,
102 ],
103 build_by_default: with_tools.contains('freedreno'),
104 install : with_tools.contains('freedreno'),
105 )
106 endif
107
108 crashdec = executable(
109 'crashdec',
110 'crashdec.c',
111 include_directories: [
112 inc_freedreno,
113 inc_freedreno_rnn,
114 inc_include,
115 inc_src,
116 ],
117 gnu_symbol_visibility: 'hidden',
118 dependencies: [],
119 link_with: [
120 libfreedreno_cffdec,
121 ],
122 build_by_default: with_tools.contains('freedreno'),
123 install : with_tools.contains('freedreno'),
124 )
125
126 if dep_libarchive.found()
127 pgmdump = executable(
128 'pgmdump',
129 'pgmdump.c',
130 include_directories: [
131 inc_freedreno,
132 inc_include,
133 inc_src,
134 ],
135 gnu_symbol_visibility: 'hidden',
136 dependencies: [],
137 link_with: [
138 libfreedreno_cffdec,
139 libfreedreno_io,
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_ir3, # for disasm_a3xx
159 ],
160 build_by_default: with_tools.contains('freedreno'),
161 install: false,
162 )
163 endif