• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright © 2018 Intel Corporation
2
3# Permission is hereby granted, free of charge, to any person obtaining a copy
4# of this software and associated documentation files (the "Software"), to deal
5# in the Software without restriction, including without limitation the rights
6# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7# copies of the Software, and to permit persons to whom the Software is
8# furnished to do so, subject to the following conditions:
9
10# The above copyright notice and this permission notice shall be included in
11# all copies or substantial portions of the Software.
12
13# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19# SOFTWARE.
20
21
22opengl32_link_args = []
23
24opengl32_def = custom_target(
25  'opengl32.def',
26  input: 'opengl32.def.in',
27  output : 'opengl32.def',
28  command : gen_vs_module_defs_normal_command,
29)
30
31libopengl32 = shared_library(
32  'opengl32',
33  ['stw_wgl.c'],
34  vs_module_defs : opengl32_def,
35  include_directories : [
36    inc_include, inc_wgl, inc_src, inc_gallium,
37  ],
38  link_with : [
39    libgallium_wgl, libglapi_bridge, libglapi
40  ],
41  dependencies : [
42    idep_mesautil
43  ],
44  c_args : ['-D_GDI32_'],
45  link_args : opengl32_link_args,
46  name_prefix : '',  # otherwise mingw will create libopengl32.dll
47  install : true,
48)
49
50if with_tests
51  extra_test_defs = []
52
53  # The generated MinGW 32-bits import libraries are always broken due to missing @nn suffix on
54  # symbols, no matter what we do.  So instead we use the builtin libopengl32.a
55  extra_test_deps = [cpp.find_library('opengl32')]
56
57  if with_gallium_d3d12
58    extra_test_defs += ['-DGALLIUM_D3D12']
59    extra_test_deps += [cpp.find_library('d3d12')]
60  endif
61
62  test_wgl = executable(
63    'test_wgl',
64    files('tests/wgl_tests.cpp'),
65    cpp_args : [cpp_msvc_compat_args, extra_test_defs],
66    dependencies : [idep_gtest, dep_dxheaders, extra_test_deps],
67  )
68
69  wgl_test_env = environment()
70  wgl_test_env.append('PATH', libgallium_wgl_build_dir)
71  if with_shared_glapi
72    wgl_test_env.append('PATH', libglapi_build_dir)
73  endif
74
75  test(
76    'wgl',
77    test_wgl,
78    suite : ['wgl'],
79    env : wgl_test_env,
80    depends : [libopengl32],
81    protocol : 'gtest',
82  )
83endif
84