74b3fd690d6e2c0b1532ad2af6aed25ba36b2ea3
[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 'disasm-a3xx.c',
41 'disasm.h',
42 'instr-a2xx.h',
43 'instr-a3xx.h',
44 'pager.c',
45 'pager.h',
46 'rnnutil.c',
47 'rnnutil.h',
48 'util.h',
49 ],
50 include_directories: [
51 inc_freedreno_rnn,
52 inc_include,
53 inc_src,
54 ],
55 c_args : [ no_override_init_args ],
56 gnu_symbol_visibility: 'hidden',
57 dependencies: [],
58 link_with: libfreedreno_rnn,
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_rnn,
89 inc_include,
90 inc_src,
91 ],
92 c_args : [no_override_init_args],
93 gnu_symbol_visibility: 'hidden',
94 dependencies: [
95 dep_lua,
96 ],
97 link_with: [
98 libfreedreno_cffdec,
99 libfreedreno_io,
100 ],
101 build_by_default: with_tools.contains('freedreno'),
102 install : with_tools.contains('freedreno'),
103 )
104 endif
105
106 crashdec = executable(
107 'crashdec',
108 'crashdec.c',
109 include_directories: [
110 inc_freedreno_rnn,
111 inc_include,
112 inc_src,
113 ],
114 gnu_symbol_visibility: 'hidden',
115 dependencies: [],
116 link_with: [
117 libfreedreno_cffdec,
118 ],
119 build_by_default: with_tools.contains('freedreno'),
120 install : with_tools.contains('freedreno'),
121 )
122
123 if dep_libarchive.found()
124 pgmdump = executable(
125 'pgmdump',
126 'pgmdump.c',
127 include_directories: [
128 inc_include,
129 inc_src,
130 ],
131 gnu_symbol_visibility: 'hidden',
132 dependencies: [],
133 link_with: [
134 libfreedreno_cffdec,
135 libfreedreno_io,
136 ],
137 build_by_default: with_tools.contains('freedreno'),
138 install: false,
139 )
140 pgmdump2 = executable(
141 'pgmdump2',
142 'pgmdump2.c',
143 include_directories: [
144 inc_include,
145 inc_src,
146 ],
147 gnu_symbol_visibility: 'hidden',
148 dependencies: [],
149 link_with: [
150 libfreedreno_cffdec,
151 libfreedreno_io,
152 ],
153 build_by_default: with_tools.contains('freedreno'),
154 install: false,
155 )
156 endif