0ec9995aa744024cf81c27ed7cf3a569575e524d
[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 ],
53 c_args : [ no_override_init_args ],
54 gnu_symbol_visibility: 'hidden',
55 dependencies: [],
56 link_with: libfreedreno_rnn,
57 build_by_default: false,
58 )
59
60 if dep_libarchive.found()
61 libfreedreno_io = static_library(
62 'libfreedreno_io',
63 [
64 'io.c',
65 'io.h',
66 ],
67 include_directories: [],
68 c_args : [no_override_init_args],
69 gnu_symbol_visibility: 'hidden',
70 dependencies: [
71 dep_libarchive,
72 ],
73 build_by_default: false,
74 )
75 endif
76
77 if dep_lua.found() and dep_libarchive.found()
78 cffdump = executable(
79 'cffdump',
80 [
81 'cffdump.c',
82 'script.c',
83 'script.h'
84 ],
85 include_directories: [
86 inc_freedreno_rnn,
87 ],
88 c_args : [no_override_init_args],
89 gnu_symbol_visibility: 'hidden',
90 dependencies: [
91 dep_lua,
92 ],
93 link_with: [
94 libfreedreno_cffdec,
95 libfreedreno_io,
96 ],
97 build_by_default: with_tools.contains('freedreno'),
98 install : with_tools.contains('freedreno'),
99 )
100 endif
101
102 crashdec = executable(
103 'crashdec',
104 'crashdec.c',
105 include_directories: [
106 inc_freedreno_rnn,
107 ],
108 gnu_symbol_visibility: 'hidden',
109 dependencies: [],
110 link_with: [
111 libfreedreno_cffdec,
112 ],
113 build_by_default: with_tools.contains('freedreno'),
114 install : with_tools.contains('freedreno'),
115 )
116
117 if dep_libarchive.found()
118 pgmdump = executable(
119 'pgmdump',
120 'pgmdump.c',
121 include_directories: [],
122 gnu_symbol_visibility: 'hidden',
123 dependencies: [],
124 link_with: [
125 libfreedreno_cffdec,
126 libfreedreno_io,
127 ],
128 build_by_default: with_tools.contains('freedreno'),
129 install: false,
130 )
131 pgmdump2 = executable(
132 'pgmdump2',
133 'pgmdump2.c',
134 include_directories: [],
135 gnu_symbol_visibility: 'hidden',
136 dependencies: [],
137 link_with: [
138 libfreedreno_cffdec,
139 libfreedreno_io,
140 ],
141 build_by_default: with_tools.contains('freedreno'),
142 install: false,
143 )
144 endif