xref: /aosp_15_r20/external/mesa3d/src/etnaviv/hwdb/meson.build (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1# Copyright © 2024 Igalia S.L.
2# SPDX-License-Identifier: MIT
3
4has_pycparser = run_command(
5  prog_python, '-c',
6  '''
7try:
8  from packaging.version import Version
9except:
10  from distutils.version import StrictVersion as Version
11import pycparser
12assert Version(pycparser.__version__) >= Version("2.20")
13  ''', check: false)
14if has_pycparser.returncode() != 0
15  error('Python (3.x) pycparser module >= 2.20 required to build mesa.')
16endif
17
18prog_hwdb = files('hwdb.h.py')
19hwdb_h = custom_target(
20  'hwdb.h',
21  input: [
22    'amlogic/gc_feature_database.h',
23    'nxp/gc_feature_database.h',
24    'st/gc_feature_database.h'
25  ],
26  output: 'hwdb.h',
27  command: [prog_python, prog_hwdb, '--output', '@OUTPUT@', '@INPUT@'],
28)
29
30libetnaviv_hwdb_files = [
31  hwdb_h,
32  'etna_hwdb.c',
33]
34
35libetnaviv_hwdb = static_library(
36  'etnaviv_hwdb',
37  libetnaviv_hwdb_files,
38  dependencies: idep_etna_common,
39  c_args : [no_override_init_args],
40  gnu_symbol_visibility : 'hidden',
41  build_by_default : false,
42)
43