xref: /aosp_15_r20/external/mesa3d/src/gallium/targets/libgl-gdi/meson.build (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1# Copyright © 2018 Intel Corporation
2# SPDX-License-Identifier: MIT
3
4opengl32_link_args = []
5
6opengl32_def = custom_target(
7  'opengl32.def',
8  input: 'opengl32.def.in',
9  output : 'opengl32.def',
10  command : gen_vs_module_defs_normal_command,
11)
12
13libopengl32 = shared_library(
14  'opengl32',
15  ['stw_wgl.c'],
16  vs_module_defs : opengl32_def,
17  include_directories : [
18    inc_include, inc_wgl, inc_src, inc_gallium,
19  ],
20  link_with : [
21    libgallium_wgl, libglapi_bridge, libglapi
22  ],
23  dependencies : [
24    idep_mesautil
25  ],
26  c_args : ['-D_GDI32_'],
27  link_args : opengl32_link_args,
28  name_prefix : '',  # otherwise mingw will create libopengl32.dll
29  install : true,
30)
31
32if with_tests
33  extra_test_defs = []
34
35  # The generated MinGW 32-bits import libraries are always broken due to missing @nn suffix on
36  # symbols, no matter what we do.  So instead we use the builtin libopengl32.a
37  extra_test_deps = [cpp.find_library('opengl32')]
38
39  if with_gallium_d3d12
40    extra_test_defs += ['-DGALLIUM_D3D12']
41    extra_test_deps += [cpp.find_library('d3d12')]
42  endif
43
44  test_wgl = executable(
45    'test_wgl',
46    files('tests/wgl_tests.cpp'),
47    cpp_args : [cpp_msvc_compat_args, extra_test_defs],
48    dependencies : [idep_gtest, dep_dxheaders, extra_test_deps],
49  )
50
51  wgl_test_env = environment()
52  wgl_test_env.append('PATH', libgallium_wgl_build_dir)
53  if with_shared_glapi
54    wgl_test_env.append('PATH', libglapi_build_dir)
55  endif
56
57  test(
58    'wgl',
59    test_wgl,
60    suite : ['wgl'],
61    env : wgl_test_env,
62    depends : [libopengl32],
63    protocol : 'gtest',
64  )
65endif
66