xref: /aosp_15_r20/external/mesa3d/src/mapi/es2api/meson.build (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1# Copyright © 2017 Intel Corporation
2# SPDX-License-Identifier: MIT
3
4es2_glapi_mapi_tmp_h = custom_target(
5  'es2_glapi_mapi_tmp.h',
6  input : [glapi_gen_mapi_py, glapi_gen_gl_xml],
7  output : 'glapi_mapi_tmp.h',
8  command : [prog_python, '@INPUT0@', 'glesv2', '@INPUT1@'],
9  depend_files : glapi_gen_mapi_deps,
10  capture : true,
11)
12
13_es2_c_args = []
14if with_platform_windows
15  _es2_c_args += ['-D_GDI32_']
16endif
17
18gles2_def = custom_target(
19  'gles2.def',
20  input: 'gles2.def.in',
21  output : 'gles2.def',
22  command : gen_vs_module_defs_normal_command,
23)
24
25libgles2 = shared_library(
26  'GLESv2' + get_option('gles-lib-suffix'),
27  ['../entry.c', es2_glapi_mapi_tmp_h],
28  vs_module_defs : gles2_def,
29  c_args : [
30    c_msvc_compat_args,
31    _es2_c_args,
32    '-DMAPI_MODE_BRIDGE',
33    '-DMAPI_ABI_HEADER="@0@"'.format(es2_glapi_mapi_tmp_h.full_path()),
34    gcc_lto_quirk,
35  ],
36  gnu_symbol_visibility : 'hidden',
37  link_args : [ld_args_gc_sections],
38  include_directories : [inc_src, inc_include, inc_mapi],
39  link_with : libglapi,
40  dependencies : [dep_thread, dep_libdrm, dep_m, dep_dl, idep_mesautilc11],
41  soversion : host_machine.system() == 'windows' ? '' : '2',
42  version : '2.0.0',
43  darwin_versions : '3.0.0',
44  name_prefix : host_machine.system() == 'windows' ? 'lib' : [],  # always use lib, but avoid warnings on !windows
45  install : true,
46)
47
48pkg.generate(
49  name : 'glesv2',
50  filebase : 'glesv2',
51  description : 'Mesa OpenGL ES 2.0 library',
52  version : meson.project_version(),
53  libraries : libgles2,
54  libraries_private : gl_priv_libs,
55)
56
57if with_symbols_check
58  test(
59    'es2-ABI-check',
60    symbols_check,
61    args : [
62      '--lib', libgles2,
63      '--symbols-file', files('gles2-symbols.txt'),
64      symbols_check_args,
65    ],
66    suite : ['mapi'],
67  )
68endif
69