xref: /aosp_15_r20/external/libdrm/freedreno/meson.build (revision 7688df22e49036ff52a766b7101da3a49edadb8c)
1*7688df22SAndroid Build Coastguard Worker# Copyright © 2017-2018 Intel Corporation
2*7688df22SAndroid Build Coastguard Worker
3*7688df22SAndroid Build Coastguard Worker# Permission is hereby granted, free of charge, to any person obtaining a copy
4*7688df22SAndroid Build Coastguard Worker# of this software and associated documentation files (the "Software"), to deal
5*7688df22SAndroid Build Coastguard Worker# in the Software without restriction, including without limitation the rights
6*7688df22SAndroid Build Coastguard Worker# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7*7688df22SAndroid Build Coastguard Worker# copies of the Software, and to permit persons to whom the Software is
8*7688df22SAndroid Build Coastguard Worker# furnished to do so, subject to the following conditions:
9*7688df22SAndroid Build Coastguard Worker
10*7688df22SAndroid Build Coastguard Worker# The above copyright notice and this permission notice shall be included in
11*7688df22SAndroid Build Coastguard Worker# all copies or substantial portions of the Software.
12*7688df22SAndroid Build Coastguard Worker
13*7688df22SAndroid Build Coastguard Worker# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14*7688df22SAndroid Build Coastguard Worker# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15*7688df22SAndroid Build Coastguard Worker# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16*7688df22SAndroid Build Coastguard Worker# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17*7688df22SAndroid Build Coastguard Worker# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18*7688df22SAndroid Build Coastguard Worker# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19*7688df22SAndroid Build Coastguard Worker# SOFTWARE.
20*7688df22SAndroid Build Coastguard Worker
21*7688df22SAndroid Build Coastguard Workerfiles_freedreno = files(
22*7688df22SAndroid Build Coastguard Worker  'freedreno_device.c',
23*7688df22SAndroid Build Coastguard Worker  'freedreno_pipe.c',
24*7688df22SAndroid Build Coastguard Worker  'freedreno_ringbuffer.c',
25*7688df22SAndroid Build Coastguard Worker  'freedreno_bo.c',
26*7688df22SAndroid Build Coastguard Worker  'freedreno_bo_cache.c',
27*7688df22SAndroid Build Coastguard Worker  'msm/msm_bo.c',
28*7688df22SAndroid Build Coastguard Worker  'msm/msm_device.c',
29*7688df22SAndroid Build Coastguard Worker  'msm/msm_pipe.c',
30*7688df22SAndroid Build Coastguard Worker  'msm/msm_ringbuffer.c',
31*7688df22SAndroid Build Coastguard Worker)
32*7688df22SAndroid Build Coastguard Worker
33*7688df22SAndroid Build Coastguard Workerif with_freedreno_kgsl
34*7688df22SAndroid Build Coastguard Worker  files_freedreno += files(
35*7688df22SAndroid Build Coastguard Worker    'kgsl/kgsl_bo.c',
36*7688df22SAndroid Build Coastguard Worker    'kgsl/kgsl_device.c',
37*7688df22SAndroid Build Coastguard Worker    'kgsl/kgsl_pipe.c',
38*7688df22SAndroid Build Coastguard Worker    'kgsl/kgsl_ringbuffer.c',
39*7688df22SAndroid Build Coastguard Worker  )
40*7688df22SAndroid Build Coastguard Workerendif
41*7688df22SAndroid Build Coastguard Worker
42*7688df22SAndroid Build Coastguard Workerlibdrm_freedreno = library(
43*7688df22SAndroid Build Coastguard Worker  'drm_freedreno',
44*7688df22SAndroid Build Coastguard Worker  [files_freedreno, config_file],
45*7688df22SAndroid Build Coastguard Worker  c_args : libdrm_c_args,
46*7688df22SAndroid Build Coastguard Worker  include_directories : [inc_root, inc_drm],
47*7688df22SAndroid Build Coastguard Worker  dependencies : [dep_valgrind, dep_threads, dep_rt, dep_atomic_ops],
48*7688df22SAndroid Build Coastguard Worker  link_with : libdrm,
49*7688df22SAndroid Build Coastguard Worker  version : '1.@[email protected]'.format(patch_ver),
50*7688df22SAndroid Build Coastguard Worker  install : true,
51*7688df22SAndroid Build Coastguard Worker)
52*7688df22SAndroid Build Coastguard Worker
53*7688df22SAndroid Build Coastguard Workerext_libdrm_freedreno = declare_dependency(
54*7688df22SAndroid Build Coastguard Worker  link_with : [libdrm, libdrm_freedreno],
55*7688df22SAndroid Build Coastguard Worker  include_directories : [inc_drm, include_directories('.')],
56*7688df22SAndroid Build Coastguard Worker)
57*7688df22SAndroid Build Coastguard Worker
58*7688df22SAndroid Build Coastguard Workerif meson.version().version_compare('>= 0.54.0')
59*7688df22SAndroid Build Coastguard Worker  meson.override_dependency('libdrm_freedreno', ext_libdrm_freedreno)
60*7688df22SAndroid Build Coastguard Workerendif
61*7688df22SAndroid Build Coastguard Worker
62*7688df22SAndroid Build Coastguard Workerinstall_headers(
63*7688df22SAndroid Build Coastguard Worker  'freedreno_drmif.h', 'freedreno_ringbuffer.h',
64*7688df22SAndroid Build Coastguard Worker  subdir : 'freedreno'
65*7688df22SAndroid Build Coastguard Worker)
66*7688df22SAndroid Build Coastguard Worker
67*7688df22SAndroid Build Coastguard Workerpkg.generate(
68*7688df22SAndroid Build Coastguard Worker  libdrm_freedreno,
69*7688df22SAndroid Build Coastguard Worker  name : 'libdrm_freedreno',
70*7688df22SAndroid Build Coastguard Worker  subdirs : ['.', 'libdrm', 'freedreno'],
71*7688df22SAndroid Build Coastguard Worker  description : 'Userspace interface to freedreno kernel DRM services',
72*7688df22SAndroid Build Coastguard Worker)
73*7688df22SAndroid Build Coastguard Worker
74*7688df22SAndroid Build Coastguard Workertest(
75*7688df22SAndroid Build Coastguard Worker  'freedreno-symbols-check',
76*7688df22SAndroid Build Coastguard Worker  symbols_check,
77*7688df22SAndroid Build Coastguard Worker  args : [
78*7688df22SAndroid Build Coastguard Worker    '--lib', libdrm_freedreno,
79*7688df22SAndroid Build Coastguard Worker    '--symbols-file', files('freedreno-symbols.txt'),
80*7688df22SAndroid Build Coastguard Worker    '--nm', prog_nm.full_path(),
81*7688df22SAndroid Build Coastguard Worker  ],
82*7688df22SAndroid Build Coastguard Worker)
83