| 1 |
# Copyright © 2025 Imagination Technologies Ltd. |
| 2 |
# based in part on intel driver which is: |
| 3 |
# Copyright 2017 Intel Corporation |
| 4 |
# SPDX-License-Identifier: MIT |
| 5 |
|
| 6 |
if get_option('precomp-compiler') == 'system' |
| 7 |
prog_pco_clc = find_program('pco_clc', native : true) |
| 8 |
else |
| 9 |
prog_pco_clc = executable( |
| 10 |
'pco_clc', |
| 11 |
['pco_clc.c'], |
| 12 |
link_with : [libpowervr_compiler, libpowervr_common], |
| 13 |
include_directories : [inc_imagination, inc_include, inc_src], |
| 14 |
c_args : [pre_args, no_override_init_args], |
| 15 |
link_args : [ld_args_build_id], |
| 16 |
dependencies : [idep_vtn, idep_nir, idep_mesautil], |
| 17 |
# If we can run host binaries directly, just build pco_clc for the host. |
| 18 |
# Most commonly this happens when doing a cross compile from an x86_64 build |
| 19 |
# machine to an x86 host |
| 20 |
native : not meson.can_run_host_binaries(), |
| 21 |
install : get_option('install-precomp-compiler'), |
| 22 |
) |
| 23 |
endif |
| 24 |
|
| 25 |
### |
| 26 |
|
| 27 |
uscgen_devices = get_option('imagination-uscgen-devices') |
| 28 |
foreach uscgen_device : uscgen_devices |
| 29 |
device_info_path = join_paths(pvr_device_info_dir, uscgen_device + '.h') |
| 30 |
if not fs.is_file(device_info_path) |
| 31 |
error('Missing device info for ' + uscgen_device) |
| 32 |
endif |
| 33 |
endforeach |
| 34 |
|
| 35 |
pco_uscgen_programs = custom_target( |
| 36 |
'pco_uscgen_programs', |
| 37 |
input : pco_usclib_spv, |
| 38 |
output : ['pco_uscgen_programs.h', 'pco_uscgen_programs.c'], |
| 39 |
command : [prog_pco_clc, pco_usclib_spv, '@OUTPUT@', uscgen_devices], |
| 40 |
env: ['PCO_DEBUG=no_pred_cf'], |
| 41 |
) |
| 42 |
|
| 43 |
idep_pco_uscgen_programs_headers = declare_dependency( |
| 44 |
sources : [pco_uscgen_programs[0]], |
| 45 |
include_directories : include_directories('.'), |
| 46 |
) |
| 47 |
|
| 48 |
idep_pco_uscgen_programs = declare_dependency( |
| 49 |
sources : [pco_uscgen_programs], |
| 50 |
dependencies : idep_pco_uscgen_programs_headers, |
| 51 |
) |
| 52 |
|
| 53 |
### |
| 54 |
|
| 55 |
libpowervr_uscgen = static_library( |
| 56 |
'powervr_uscgen', |
| 57 |
[pco_uscgen_programs], |
| 58 |
include_directories : [inc_imagination], |
| 59 |
c_args : [no_override_init_args], |
| 60 |
gnu_symbol_visibility : 'hidden', |
| 61 |
dependencies: [idep_nir, idep_mesautil], |
| 62 |
) |