| 1 |
# Copyright 2018 Rob Clark |
| 2 |
# Copyright 2019 Collabora, Ltd. |
| 3 |
# Copyright 2017 Intel Corporation |
| 4 |
# SPDX-License-Identifier: MIT |
| 5 |
|
| 6 |
libasahi_lib_files = files( |
| 7 |
'agx_bo.c', |
| 8 |
'agx_border.c', |
| 9 |
'agx_device.c', |
| 10 |
'agx_device_virtio.c', |
| 11 |
'agx_linker.c', |
| 12 |
'agx_bg_eot.c', |
| 13 |
'agx_tilebuffer.c', |
| 14 |
'agx_nir_lower_msaa.c', |
| 15 |
'agx_nir_lower_sample_intrinsics.c', |
| 16 |
'agx_nir_lower_tilebuffer.c', |
| 17 |
'agx_nir_lower_uvs.c', |
| 18 |
'agx_nir_lower_vbo.c', |
| 19 |
'agx_nir_prolog_epilog.c', |
| 20 |
'agx_ppp.h', |
| 21 |
'agx_scratch.c', |
| 22 |
'agx_va.c', |
| 23 |
'pool.c', |
| 24 |
) |
| 25 |
|
| 26 |
libasahi_decode_files = files( |
| 27 |
'decode.c', |
| 28 |
) |
| 29 |
|
| 30 |
libasahi_decode = static_library( |
| 31 |
'asahi_decode', |
| 32 |
[libasahi_decode_files, agx_pack], |
| 33 |
dependencies : [dep_valgrind, idep_mesautil], |
| 34 |
c_args : [no_override_init_args, '-Wno-c2x-extensions'], |
| 35 |
gnu_symbol_visibility : 'hidden', |
| 36 |
link_with : [libagx2_disasm], |
| 37 |
build_by_default : false, |
| 38 |
) |
| 39 |
|
| 40 |
libasahi_decode_shared = shared_library( |
| 41 |
'asahi_decode', |
| 42 |
[libasahi_decode_files, agx_pack], |
| 43 |
dependencies : [dep_valgrind, idep_mesautil], |
| 44 |
c_args : [no_override_init_args, '-Wno-c2x-extensions'], |
| 45 |
build_by_default : with_tools.contains('asahi'), |
| 46 |
link_with : [libagx2_disasm], |
| 47 |
) |
| 48 |
|
| 49 |
libagx_shaders = custom_target( |
| 50 |
input : libagx_spv, |
| 51 |
output : ['libagx_shaders.h', 'libagx_shaders.c'], |
| 52 |
command : [prog_asahi_clc, libagx_spv, '@OUTPUT0@', '@OUTPUT1@'], |
| 53 |
) |
| 54 |
|
| 55 |
idep_libagx_shaders_h = declare_dependency( |
| 56 |
sources : [libagx_shaders], |
| 57 |
include_directories : include_directories('.'), |
| 58 |
) |
| 59 |
|
| 60 |
libasahi_lib = static_library( |
| 61 |
'asahi_lib', |
| 62 |
[libasahi_lib_files, libagx_shaders, agx_pack, sha1_h], |
| 63 |
include_directories : [inc_asahi, inc_virtio_gpu, inc_virtio_vdrm], |
| 64 |
c_args : [no_override_init_args, '-Wno-c2x-extensions'], |
| 65 |
gnu_symbol_visibility : 'hidden', |
| 66 |
link_with: [libasahi_decode, libvdrm, libpoly_nir], |
| 67 |
dependencies: [dep_libdrm, dep_valgrind, idep_nir, idep_mesautil, idep_libagx, idep_libpoly], |
| 68 |
build_by_default : false, |
| 69 |
) |
| 70 |
|
| 71 |
if with_tests |
| 72 |
test( |
| 73 |
'libasahi_tests', |
| 74 |
executable( |
| 75 |
'libasahi_tests', |
| 76 |
files( |
| 77 |
'tests/test-packing.cpp', |
| 78 |
'tests/test-tilebuffer.cpp', |
| 79 |
), |
| 80 |
c_args : [c_msvc_compat_args, no_override_init_args], |
| 81 |
gnu_symbol_visibility : 'hidden', |
| 82 |
dependencies: [idep_gtest, idep_agx_pack, idep_mesautil], |
| 83 |
link_with : [libasahi_lib, libasahi_layout], |
| 84 |
), |
| 85 |
suite : ['asahi'], |
| 86 |
protocol : 'gtest', |
| 87 |
) |
| 88 |
endif |
| 89 |
|
| 90 |
if dep_iokit.found() |
| 91 |
libasahi_wrap = shared_library( |
| 92 |
'wrap', |
| 93 |
'wrap.c', |
| 94 |
include_directories : [inc_src, inc_asahi], |
| 95 |
dependencies : [idep_mesautil, dep_iokit], |
| 96 |
c_args : [no_override_init_args, '-Wno-missing-prototypes'], |
| 97 |
gnu_symbol_visibility : 'hidden', |
| 98 |
build_by_default : with_tools.contains('asahi'), |
| 99 |
link_with: libasahi_decode, |
| 100 |
) |
| 101 |
endif |