Path: blob/21.2-virgl/src/mapi/glapi/meson.build
4560 views
# Copyright © 2017 Intel Corporation12# Permission is hereby granted, free of charge, to any person obtaining a copy3# of this software and associated documentation files (the "Software"), to deal4# in the Software without restriction, including without limitation the rights5# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell6# copies of the Software, and to permit persons to whom the Software is7# furnished to do so, subject to the following conditions:89# The above copyright notice and this permission notice shall be included in10# all copies or substantial portions of the Software.1112# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR13# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,14# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE15# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER16# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,17# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE18# SOFTWARE.1920subdir('gen')2122inc_glapi = include_directories('.')2324static_glapi_files = []25static_glapi_args = []2627if with_dri and ['apple', 'windows'].contains(with_dri_platform)28static_glapi_files += [glapi_gentable_c, glapitable_h]29endif3031if with_shared_glapi32static_glapi_files += files(33'../entry.c',34'../entry.h',35'../entry_x86-64_tls.h',36'../entry_x86_tls.h',37'../entry_x86_tsd.h',38'../entry_ppc64le_tls.h',39'../entry_ppc64le_tsd.h',40'../mapi_tmp.h',41)42static_glapi_files += glapi_mapi_tmp_h43static_glapi_args += [44'-DMAPI_MODE_BRIDGE',45'-DMAPI_ABI_HEADER="@0@"'.format(glapi_mapi_tmp_h.full_path()),46gcc_lto_quirk,47]48if with_platform_windows49static_glapi_args += ['-D_GDI32_', '-DBUILD_GL32']50endif51else52static_glapi_args += '-DMAPI_MODE_UTIL'53if with_platform_windows54static_glapi_args += ['-D_GDI32_', '-DBUILD_GL32', '-DKHRONOS_DLL_EXPORTS']55if with_shared_glapi56static_glapi_args += '-D_GLAPI_DLL_EXPORTS'57else58static_glapi_args += '-D_GLAPI_NO_EXPORTS'59endif60endif61static_glapi_files += files(62'glapi_dispatch.c',63'glapi_entrypoint.c',64'glapi_getproc.c',65'glapi_nop.c',66'glapi.c',67'glapi.h',68'glapi_priv.h',69)70static_glapi_files += files_mapi_util71static_glapi_files += [72glapitable_h, glapi_mapi_tmp_h, glprocs_h, glapitemp_h,73]74if with_asm_arch == 'x86'75static_glapi_files += glapi_x86_s76elif with_asm_arch == 'x86_64'77static_glapi_files += glapi_x86_64_s78elif with_asm_arch == 'sparc'79static_glapi_files += glapi_sparc_s80endif81endif8283libglapi_static = static_library(84'glapi_static',85static_glapi_files,86include_directories : [inc_mesa, inc_include, inc_src, inc_mapi],87c_args : [c_msvc_compat_args, static_glapi_args],88dependencies : [dep_thread, dep_selinux],89build_by_default : false,90)9192# TODO: this test doesn't compile on windows with mingw or msvc due to93# undefined symbols from libglapi_static, but that should be fixable.94if with_any_opengl and not with_shared_glapi and with_tests and not with_platform_windows95test(96'glapi_static_check_table',97executable(98'glapi_static_check_table',99['tests/check_table.cpp', glapitable_h],100include_directories : [inc_include, inc_src, inc_mesa, inc_mapi],101link_with : [libglapi_static],102dependencies : [idep_gtest, dep_thread],103),104suite : ['mapi'],105)106endif107108109