1
# Copyright © 2018 Intel Corporation
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:
10
# The above copyright notice and this permission notice shall be included in
11
# all copies or substantial portions of the Software.
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
22
opengl32_link_args = []
23
if cc.get_id() == 'gcc' and host_machine.cpu_family() != 'x86_64'
24
opengl32_link_args += ['-Wl,--enable-stdcall-fixup']
27
if cc.get_id() == 'gcc' and host_machine.cpu_family() != 'x86_64'
28
ogl_def = 'opengl32.mingw.def'
30
ogl_def = 'opengl32.def'
33
libopengl32 = shared_library(
36
vs_module_defs : ogl_def,
37
include_directories : [
38
inc_include, inc_wgl, inc_src,
41
libgallium_wgl, libglapi_static, libglapi
46
c_args : ['-D_GDI32_'],
47
link_args : opengl32_link_args,
48
name_prefix : '', # otherwise mingw will create libopengl32.dll
55
# The generated MinGW 32-bits import libraries are always broken due to missing @nn suffix on
56
# symbols, no matter what we do. So instead we use the builtin libopengl32.a
57
extra_test_deps = [cpp.find_library('opengl32')]
60
extra_test_defs += ['-DGALLIUM_D3D12']
61
extra_test_deps += [cpp.find_library('d3d12')]
64
test_wgl = executable(
66
files('tests/wgl_tests.cpp'),
67
cpp_args : [cpp_msvc_compat_args, extra_test_defs],
68
dependencies : [idep_gtest, dep_dxheaders, extra_test_deps],
71
# The CI pipeline for MinGW doesn't support creating a window, so don't run these tests there
72
if with_tests and cc.get_id() != 'gcc'
73
wgl_test_env = environment()
74
wgl_test_env.append('PATH', libgallium_wgl_build_dir)
76
wgl_test_env.append('PATH', libglapi_build_dir)
84
depends : [libopengl32],
85
protocol : gtest_test_protocol,