1bf215546Sopenharmony_ci# Copyright © 2017 Intel Corporation 2bf215546Sopenharmony_ci 3bf215546Sopenharmony_ci# Permission is hereby granted, free of charge, to any person obtaining a copy 4bf215546Sopenharmony_ci# of this software and associated documentation files (the "Software"), to deal 5bf215546Sopenharmony_ci# in the Software without restriction, including without limitation the rights 6bf215546Sopenharmony_ci# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7bf215546Sopenharmony_ci# copies of the Software, and to permit persons to whom the Software is 8bf215546Sopenharmony_ci# furnished to do so, subject to the following conditions: 9bf215546Sopenharmony_ci 10bf215546Sopenharmony_ci# The above copyright notice and this permission notice shall be included in 11bf215546Sopenharmony_ci# all copies or substantial portions of the Software. 12bf215546Sopenharmony_ci 13bf215546Sopenharmony_ci# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14bf215546Sopenharmony_ci# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15bf215546Sopenharmony_ci# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16bf215546Sopenharmony_ci# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17bf215546Sopenharmony_ci# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18bf215546Sopenharmony_ci# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19bf215546Sopenharmony_ci# SOFTWARE. 20bf215546Sopenharmony_ci 21bf215546Sopenharmony_cies1_glapi_mapi_tmp_h = custom_target( 22bf215546Sopenharmony_ci 'es1_glapi_mapi_tmp.h', 23bf215546Sopenharmony_ci input : [glapi_gen_mapi_py, glapi_gen_gl_xml], 24bf215546Sopenharmony_ci output : 'glapi_mapi_tmp.h', 25bf215546Sopenharmony_ci command : [prog_python, '@INPUT0@', 'glesv1', '@INPUT1@'], 26bf215546Sopenharmony_ci depend_files : glapi_gen_mapi_deps, 27bf215546Sopenharmony_ci capture : true, 28bf215546Sopenharmony_ci) 29bf215546Sopenharmony_ci 30bf215546Sopenharmony_ci_es1_c_args = [] 31bf215546Sopenharmony_ciif with_platform_windows 32bf215546Sopenharmony_ci _es1_c_args += ['-D_GDI32_'] 33bf215546Sopenharmony_ciendif 34bf215546Sopenharmony_ci 35bf215546Sopenharmony_cigles1_def = custom_target( 36bf215546Sopenharmony_ci 'gles1.def', 37bf215546Sopenharmony_ci input: 'gles1.def.in', 38bf215546Sopenharmony_ci output : 'gles1.def', 39bf215546Sopenharmony_ci command : [prog_python, gen_vs_module_defs_py, 40bf215546Sopenharmony_ci '--in_file', '@INPUT@', '--out_file', '@OUTPUT@', 41bf215546Sopenharmony_ci '--compiler_id', cc.get_argument_syntax(), '--cpu_family', host_machine.cpu_family()] 42bf215546Sopenharmony_ci) 43bf215546Sopenharmony_ci 44bf215546Sopenharmony_cilibglesv1_cm = shared_library( 45bf215546Sopenharmony_ci 'GLESv1_CM' + get_option('gles-lib-suffix'), 46bf215546Sopenharmony_ci ['../entry.c', es1_glapi_mapi_tmp_h], 47bf215546Sopenharmony_ci vs_module_defs : gles1_def, 48bf215546Sopenharmony_ci c_args : [ 49bf215546Sopenharmony_ci c_msvc_compat_args, 50bf215546Sopenharmony_ci _es1_c_args, 51bf215546Sopenharmony_ci '-DMAPI_MODE_BRIDGE', 52bf215546Sopenharmony_ci '-DMAPI_ABI_HEADER="@0@"'.format(es1_glapi_mapi_tmp_h.full_path()), 53bf215546Sopenharmony_ci gcc_lto_quirk, 54bf215546Sopenharmony_ci ], 55bf215546Sopenharmony_ci gnu_symbol_visibility : 'hidden', 56bf215546Sopenharmony_ci link_args : [ld_args_gc_sections], 57bf215546Sopenharmony_ci include_directories : [inc_src, inc_include, inc_mapi], 58bf215546Sopenharmony_ci link_with : libglapi, 59bf215546Sopenharmony_ci dependencies : [dep_thread, dep_libdrm, dep_m, dep_dl, idep_mesautilc11], 60bf215546Sopenharmony_ci soversion : host_machine.system() == 'windows' ? '' : '1', 61bf215546Sopenharmony_ci version : '1.1.0', 62bf215546Sopenharmony_ci darwin_versions : '3.0.0', 63bf215546Sopenharmony_ci name_prefix : 'lib', 64bf215546Sopenharmony_ci install : true, 65bf215546Sopenharmony_ci) 66bf215546Sopenharmony_ci 67bf215546Sopenharmony_cipkg.generate( 68bf215546Sopenharmony_ci name : 'glesv1_cm', 69bf215546Sopenharmony_ci filebase : 'glesv1_cm', 70bf215546Sopenharmony_ci description : 'Mesa OpenGL ES 1.1 CM library', 71bf215546Sopenharmony_ci version : meson.project_version(), 72bf215546Sopenharmony_ci libraries : libglesv1_cm, 73bf215546Sopenharmony_ci libraries_private : gl_priv_libs, 74bf215546Sopenharmony_ci) 75bf215546Sopenharmony_ci 76bf215546Sopenharmony_ciif with_symbols_check 77bf215546Sopenharmony_ci test( 78bf215546Sopenharmony_ci 'es1-ABI-check', 79bf215546Sopenharmony_ci symbols_check, 80bf215546Sopenharmony_ci args : [ 81bf215546Sopenharmony_ci '--lib', libglesv1_cm, 82bf215546Sopenharmony_ci '--symbols-file', files('gles1-symbols.txt'), 83bf215546Sopenharmony_ci symbols_check_args, 84bf215546Sopenharmony_ci ], 85bf215546Sopenharmony_ci suite : ['mapi'], 86bf215546Sopenharmony_ci ) 87bf215546Sopenharmony_ciendif 88