• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#############################################################################
2#
3# Copyright (C) 2019 Collabora Ltd
4#
5# Permission is hereby granted, free of charge, to any person obtaining a
6# copy of this software and associated documentation files (the "Software"),
7# to deal in the Software without restriction, including without limitation
8# the rights to use, copy, modify, merge, publish, distribute, sublicense,
9# and/or sell copies of the Software, and to permit persons to whom the
10# Software is furnished to do so, subject to the following conditions:
11#
12# The above copyright notice and this permission notice shall be included
13# in all copies or substantial portions of the Software.
14#
15# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
19# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21# OTHER DEALINGS IN THE SOFTWARE.
22#
23
24subdir('gallium')
25
26virgl_sources = [
27   'iov.c',
28   'virgl_context.c',
29   'virgl_context.h',
30   'virgl_hw.h',
31   'virgl_protocol.h',
32   'virgl_resource.c',
33   'virgl_resource.h',
34   'virgl_util.c',
35   'virgl_util.h',
36]
37
38vrend_sources = [
39   'vrend_blitter.c',
40   'vrend_blitter.h',
41   'vrend_debug.c',
42   'vrend_debug.h',
43   'vrend_decode.c',
44   'vrend_formats.c',
45   'vrend_iov.h',
46   'vrend_object.c',
47   'vrend_object.h',
48   'vrend_renderer.c',
49   'vrend_renderer.h',
50   'vrend_shader.c',
51   'vrend_shader.h',
52   'vrend_strbuf.h',
53   'vrend_tweaks.c',
54   'vrend_tweaks.h',
55   'vrend_winsys.c',
56   'vrend_winsys.h',
57]
58
59virglrenderer_sources = [
60   'virglrenderer.c',
61   'virglrenderer.h',
62   'virglrenderer_hw.h',
63]
64
65vrend_winsys_egl_sources = [
66   'vrend_winsys_gbm.c',
67   'vrend_winsys_gbm.h',
68   'vrend_winsys_egl.c',
69   'vrend_winsys_egl.h',
70]
71
72vrend_winsys_glx_sources = [
73   'vrend_winsys_glx.c',
74   'vrend_winsys_glx.h',
75]
76
77venus_sources = [
78   'venus_hw.h',
79   'venus/venus-protocol/vn_protocol_renderer.h',
80   'venus/vkr_buffer.c',
81   'venus/vkr_buffer.h',
82   'venus/vkr_command_buffer.c',
83   'venus/vkr_command_buffer.h',
84   'venus/vkr_common.c',
85   'venus/vkr_common.h',
86   'venus/vkr_context.c',
87   'venus/vkr_context.h',
88   'venus/vkr_cs.c',
89   'venus/vkr_cs.h',
90   'venus/vkr_descriptor_set.c',
91   'venus/vkr_descriptor_set.h',
92   'venus/vkr_device.c',
93   'venus/vkr_device.h',
94   'venus/vkr_device_memory.c',
95   'venus/vkr_device_memory.h',
96   'venus/vkr_image.c',
97   'venus/vkr_image.h',
98   'venus/vkr_instance.c',
99   'venus/vkr_instance.h',
100   'venus/vkr_physical_device.c',
101   'venus/vkr_physical_device.h',
102   'venus/vkr_pipeline.c',
103   'venus/vkr_pipeline.h',
104   'venus/vkr_query_pool.c',
105   'venus/vkr_query_pool.h',
106   'venus/vkr_queue.c',
107   'venus/vkr_queue.h',
108   'venus/vkr_render_pass.c',
109   'venus/vkr_render_pass.h',
110   'venus/vkr_renderer.c',
111   'venus/vkr_renderer.h',
112   'venus/vkr_ring.c',
113   'venus/vkr_ring.h',
114   'venus/vkr_transport.c',
115   'venus/vkr_transport.h',
116]
117
118venus_codegen = custom_target(
119   'venus_codegen',
120   input : ['venus/vkr_device_object.py', 'venus/vkr_device_object.json'],
121   output : [
122      'vkr_buffer_gen.h',
123      'vkr_command_buffer_gen.h',
124      'vkr_descriptor_set_gen.h',
125      'vkr_device_memory_gen.h',
126      'vkr_image_gen.h',
127      'vkr_pipeline_gen.h',
128      'vkr_query_pool_gen.h',
129      'vkr_queue_gen.h',
130      'vkr_render_pass_gen.h',
131   ],
132   command : [prog_python, '@INPUT0@', '-o', '@OUTDIR@', '@INPUT1@'],
133)
134
135virgl_depends = [
136   gallium_dep,
137   epoxy_dep,
138   libdrm_dep,
139   thread_dep,
140   m_dep,
141]
142
143if with_tracing == 'perfetto'
144   virgl_depends += [vperfetto_min_dep]
145endif
146
147if with_tracing == 'percetto'
148   virgl_depends += [percetto_dep]
149endif
150
151virgl_sources += vrend_sources
152
153if have_egl
154   virgl_sources += vrend_winsys_egl_sources
155   virgl_depends += [gbm_dep]
156endif
157
158if have_glx
159   virgl_sources += vrend_winsys_glx_sources
160   virgl_depends += [glx_dep]
161endif
162
163if with_venus
164   virgl_sources += venus_sources
165   virgl_sources += venus_codegen
166   virgl_depends += [venus_dep]
167endif
168
169libvirgl = static_library(
170   'virgl',
171   virgl_sources,
172   include_directories: [inc_gallium, inc_configuration, 'venus'],
173   dependencies : virgl_depends,
174)
175
176libvirgl_inc = [
177   inc_gallium,
178   inc_configuration,
179   include_directories(['.', 'venus'])
180]
181
182libvirgl_dep = declare_dependency(
183   link_with: libvirgl,
184   include_directories: libvirgl_inc
185)
186
187libvirglrenderer = library(
188   'virglrenderer',
189   virglrenderer_sources,
190   include_directories: [inc_gallium, inc_configuration],
191   dependencies : [virgl_depends, libvirgl_dep],
192   version : binary_age.to_string() + '.'
193             + interface_age.to_string() + '.'
194             + revision.to_string(),
195   install : true
196)
197
198libvirglrenderer_dep = declare_dependency(
199   link_with: libvirglrenderer,
200   include_directories: libvirgl_inc,
201   dependencies : [libvirgl_dep, gallium_dep]
202)
203
204install_headers('virglrenderer.h', subdir : 'virgl')
205