summaryrefslogtreecommitdiffstats
path: root/src/mapi/glapi/meson.build
blob: 6a4f9f5733e13821abb913561758206d390a0da6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Copyright © 2017 Intel Corporation

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:

# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.

# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

subdir('gen')

inc_glapi = include_directories('.')

static_glapi_files = []
static_glapi_args = []

if ['apple', 'windows'].contains(with_dri_platform)
  static_glapi_files += [glapi_gentable_c, glapitable_h]
endif

if with_shared_glapi
  static_glapi_files += files(
    '../entry.c',
    '../entry.h',
    '../entry_x86-64_tls.h',
    '../entry_x86_tls.h',
    '../entry_x86_tsd.h',
    '../entry_ppc64le_tls.h',
    '../entry_ppc64le_tsd.h',
    '../mapi_tmp.h',
  )
  static_glapi_files += glapi_mapi_tmp_h
  static_glapi_args += [
    '-DMAPI_MODE_BRIDGE',
    '-DMAPI_ABI_HEADER="@0@"'.format(glapi_mapi_tmp_h.full_path()),
    gcc_lto_quirk,
  ]
else
  static_glapi_args += '-DMAPI_MODE_UTIL'
  static_glapi_files += files(
    'glapi_dispatch.c',
    'glapi_entrypoint.c',
    'glapi_getproc.c',
    'glapi_nop.c',
    'glapi.c',
    'glapi.h',
    'glapi_priv.h',
  )
  static_glapi_files += files_mapi_util
  static_glapi_files += [
    glapitable_h, glapi_mapi_tmp_h, glprocs_h, glapitemp_h,
  ]
  if with_asm_arch == 'x86'
    static_glapi_files += glapi_x86_s
  elif with_asm_arch == 'x86_64'
    static_glapi_files += glapi_x86_64_s
  elif with_asm_arch == 'sparc'
    static_glapi_files += glapi_sparc_s
  endif
endif

libglapi_static = static_library(
  'glapi_static',
  static_glapi_files,
  include_directories : [inc_mesa, inc_include, inc_src, inc_mapi],
  c_args : [c_msvc_compat_args, static_glapi_args],
  dependencies : [dep_thread, dep_selinux],
  build_by_default : false,
)

if with_any_opengl and not with_shared_glapi and with_tests
  test(
    'glapi_static_check_table',
    executable(
      'glapi_static_check_table',
      ['tests/check_table.cpp', glapitable_h],
      include_directories : [inc_include, inc_src, inc_mesa, inc_mapi],
      link_with : [libglapi_static],
      dependencies : [idep_gtest, dep_thread],
    ),
    suite : ['mapi'],
  )
endif