1# Copyright © 2017 Intel Corporation
2# Copyright © 2018 Alyssa Rosenzweig
3
4# Permission is hereby granted, free of charge, to any person obtaining a copy
5# of this software and associated documentation files (the "Software"), to deal
6# in the Software without restriction, including without limitation the rights
7# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8# copies of the Software, and to permit persons to whom the Software is
9# furnished to do so, subject to the following conditions:
10
11# The above copyright notice and this permission notice shall be included in
12# all copies or substantial portions of the Software.
13
14# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20# SOFTWARE.
21
22files_panfrost = files(
23  'pan_helpers.c',
24  'pan_public.h',
25  'pan_screen.c',
26  'pan_screen.h',
27  'pan_resource.c',
28  'pan_resource.h',
29  'pan_context.c',
30  'pan_blit.c',
31  'pan_job.c',
32  'pan_assemble.c',
33  'pan_compute.c',
34  'pan_mempool.c',
35  'pan_mempool.h',
36)
37
38panfrost_includes = [
39  inc_mapi,
40  inc_mesa,
41  inc_gallium,
42  inc_gallium_aux,
43  inc_include,
44  inc_src,
45  inc_panfrost,
46]
47
48compile_args_panfrost = [
49  '-DGALLIUM_PANFROST',
50  '-Wno-pointer-arith'
51]
52
53panfrost_versions = ['4', '5', '6', '7']
54libpanfrost_versions = []
55
56foreach ver : panfrost_versions
57  libpanfrost_versions += static_library(
58    'panfrost-v' + ver,
59    ['pan_cmdstream.c', pan_packers],
60    include_directories : panfrost_includes,
61    c_args : ['-DPAN_ARCH=' + ver],
62    gnu_symbol_visibility : 'hidden',
63    dependencies : [idep_pan_packers, idep_nir, dep_libdrm],
64)
65endforeach
66
67libpanfrost = static_library(
68  'panfrost',
69  files_panfrost,
70  dependencies: [
71    dep_thread,
72    dep_libdrm,
73    idep_mesautil,
74    idep_nir,
75    idep_pan_packers
76  ],
77  include_directories : panfrost_includes,
78  c_args : [c_msvc_compat_args, compile_args_panfrost],
79  gnu_symbol_visibility : 'hidden',
80  link_with: [libpanfrost_versions],
81)
82
83driver_panfrost = declare_dependency(
84  compile_args : compile_args_panfrost,
85  link_with : [libpanfrost, libpanfrostwinsys, libpanfrost_shared, libpanfrost_midgard, libpanfrost_bifrost, libpanfrost_decode, libpanfrost_lib],
86)
87