| 1 |
# Copyright © 2024 Imagination Technologies Ltd. |
| 2 |
# SPDX-License-Identifier: MIT |
| 3 |
|
| 4 |
inc_powervr_compiler = include_directories(['.']) |
| 5 |
|
| 6 |
libpowervr_compiler_files = files( |
| 7 |
'pco.c', |
| 8 |
'pco_binary.c', |
| 9 |
'pco_bool.c', |
| 10 |
'pco_cf.c', |
| 11 |
'pco_const_imms.c', |
| 12 |
'pco_debug.c', |
| 13 |
'pco_end.c', |
| 14 |
'pco_group_instrs.c', |
| 15 |
'pco_index.c', |
| 16 |
'pco_ir.c', |
| 17 |
'pco_legalize.c', |
| 18 |
'pco_nir.c', |
| 19 |
'pco_nir_compute.c', |
| 20 |
'pco_nir_io.c', |
| 21 |
'pco_nir_lower_null_descriptors.c', |
| 22 |
'pco_nir_pvfio.c', |
| 23 |
'pco_nir_sync.c', |
| 24 |
'pco_nir_tex.c', |
| 25 |
'pco_nir_vk.c', |
| 26 |
'pco_opt.c', |
| 27 |
'pco_print.c', |
| 28 |
'pco_ra.c', |
| 29 |
'pco_schedule.c', |
| 30 |
'pco_trans_nir.c', |
| 31 |
'pco_validate.c', |
| 32 |
) |
| 33 |
|
| 34 |
pco_pygen_dep_files = files('pco_pygen_common.py', 'pco_isa.py', 'pco_ops.py', 'pco_map.py') |
| 35 |
|
| 36 |
pco_builder_ops_h = custom_target( |
| 37 |
'pco_builder_ops.h', |
| 38 |
input : ['pco_builder_ops.h.py'], |
| 39 |
output : 'pco_builder_ops.h', |
| 40 |
command : [prog_python, '@INPUT@'], |
| 41 |
capture : true, |
| 42 |
depend_files : pco_pygen_dep_files, |
| 43 |
) |
| 44 |
|
| 45 |
pco_common_h = custom_target( |
| 46 |
'pco_common.h', |
| 47 |
input : ['pco_common.h.py'], |
| 48 |
output : 'pco_common.h', |
| 49 |
command : [prog_python, '@INPUT@'], |
| 50 |
capture : true, |
| 51 |
depend_files : pco_pygen_dep_files, |
| 52 |
) |
| 53 |
|
| 54 |
pco_info_c = custom_target( |
| 55 |
'pco_info.c', |
| 56 |
input : ['pco_info.c.py'], |
| 57 |
output : 'pco_info.c', |
| 58 |
command : [prog_python, '@INPUT@'], |
| 59 |
capture : true, |
| 60 |
depend_files : pco_pygen_dep_files, |
| 61 |
) |
| 62 |
|
| 63 |
pco_isa_h = custom_target( |
| 64 |
'pco_isa.h', |
| 65 |
input : ['pco_isa.h.py'], |
| 66 |
output : 'pco_isa.h', |
| 67 |
command : [prog_python, '@INPUT@'], |
| 68 |
capture : true, |
| 69 |
depend_files : pco_pygen_dep_files, |
| 70 |
) |
| 71 |
|
| 72 |
pco_map_h = custom_target( |
| 73 |
'pco_map.h', |
| 74 |
input : ['pco_map.h.py'], |
| 75 |
output : 'pco_map.h', |
| 76 |
command : [prog_python, '@INPUT@'], |
| 77 |
capture : true, |
| 78 |
depend_files : pco_pygen_dep_files, |
| 79 |
) |
| 80 |
|
| 81 |
pco_ops_h = custom_target( |
| 82 |
'pco_ops.h', |
| 83 |
input : ['pco_ops.h.py'], |
| 84 |
output : 'pco_ops.h', |
| 85 |
command : [prog_python, '@INPUT@'], |
| 86 |
capture : true, |
| 87 |
depend_files : pco_pygen_dep_files, |
| 88 |
) |
| 89 |
|
| 90 |
pco_pygen_sources = [ |
| 91 |
pco_builder_ops_h, |
| 92 |
pco_common_h, |
| 93 |
pco_info_c, |
| 94 |
pco_isa_h, |
| 95 |
pco_map_h, |
| 96 |
pco_ops_h, |
| 97 |
] |
| 98 |
|
| 99 |
idep_pco_pygen = declare_dependency( |
| 100 |
sources : pco_pygen_sources, |
| 101 |
include_directories : inc_powervr_compiler, |
| 102 |
) |
| 103 |
|
| 104 |
pco_pygen_c_files = [pco_info_c] |
| 105 |
|
| 106 |
subdir('usclib') |
| 107 |
|
| 108 |
pco_nir_algebraic_c = custom_target( |
| 109 |
'pco_nir_algebraic.c', |
| 110 |
input : 'pco_nir_algebraic.py', |
| 111 |
output : 'pco_nir_algebraic.c', |
| 112 |
command : [ |
| 113 |
prog_python, '@INPUT@', '-p', dir_compiler_nir, |
| 114 |
], |
| 115 |
capture : true, |
| 116 |
depend_files : nir_algebraic_depends, |
| 117 |
) |
| 118 |
|
| 119 |
libpowervr_compiler = static_library( |
| 120 |
'powervr_compiler', |
| 121 |
[libpowervr_compiler_files, pco_pygen_c_files, pco_nir_algebraic_c], |
| 122 |
include_directories : [ |
| 123 |
inc_imagination, |
| 124 |
inc_powervr_compiler, |
| 125 |
inc_include, |
| 126 |
inc_compiler, |
| 127 |
inc_src, |
| 128 |
], |
| 129 |
# Suppress 'parameter passing for argument of type ... changed in GCC ...' warnings. |
| 130 |
c_args : [imagination_c_args, no_override_init_args, '-Wno-psabi'], |
| 131 |
dependencies : [dep_csbgen, idep_mesautil, idep_nir, idep_pco_pygen, idep_pco_usclib], |
| 132 |
gnu_symbol_visibility : 'hidden', |
| 133 |
install : false, |
| 134 |
) |
| 135 |
|
| 136 |
subdir('uscgen') |