aboutsummaryrefslogtreecommitdiff
path: root/contrib/DirectX-Headers-1.618.2/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/DirectX-Headers-1.618.2/meson.build')
-rw-r--r--contrib/DirectX-Headers-1.618.2/meson.build64
1 files changed, 64 insertions, 0 deletions
diff --git a/contrib/DirectX-Headers-1.618.2/meson.build b/contrib/DirectX-Headers-1.618.2/meson.build
new file mode 100644
index 0000000..e358738
--- /dev/null
+++ b/contrib/DirectX-Headers-1.618.2/meson.build
@@ -0,0 +1,64 @@
1# Copyright (c) Microsoft Corporation.
2# Licensed under the MIT License.
3
4project('DirectX-Headers', 'cpp', version : '1.618.2',
5 default_options : ['cpp_std=c++14'])
6
7cpp = meson.get_compiler('cpp')
8compiler_id = cpp.get_id()
9#d3d12_lib is not available in linux
10d3d12_lib = cpp.find_library('d3d12', required : host_machine.system() == 'windows')
11#dxcore is not available in Mingw-w64
12dxcore_lib = cpp.find_library('dxcore', required: compiler_id == 'msvc')
13test_compile_opts = []
14if host_machine.system() == 'windows'
15 test_compile_opts = ['-DUNICODE', '-D_WIN32_WINNT=0x0A00']
16endif
17if (compiler_id == 'gcc') or (compiler_id == 'clang')
18 test_compile_opts += ['-Wno-unused-variable']
19endif
20
21inc_dirs = [include_directories('include', is_system : true)]
22install_inc_subdirs = ['']
23compile_options = []
24
25if host_machine.system() != 'windows'
26 inc_dirs += include_directories('include/wsl/stubs', is_system : true)
27 install_inc_subdirs += ['', 'wsl/stubs', 'directx']
28elif meson.get_compiler('cpp').get_id() != 'msvc' and meson.get_compiler('cpp').get_id() != 'clang-cl'
29 # MinGW has RPC headers which define old versions, and complain if D3D
30 # headers are included before the RPC headers, since D3D headers were
31 # generated with new MIDL and "require" new RPC headers.
32 compile_options = ['-D__REQUIRED_RPCNDR_H_VERSION__=475']
33endif
34
35format_properties_lib = static_library(
36 'd3dx12-format-properties',
37 'src/d3dx12_property_format_table.cpp',
38 include_directories : [inc_dirs, 'include/directx'],
39 cpp_args : compile_options,
40 install : true)
41guids_lib = static_library('DirectX-Guids', 'src/dxguids.cpp', include_directories : inc_dirs, install : true)
42
43dep_dxheaders = declare_dependency(
44 link_with : [format_properties_lib, guids_lib],
45 include_directories : inc_dirs,
46 compile_args : compile_options)
47
48if meson.version().version_compare('>=0.54.0')
49 meson.override_dependency('DirectX-Headers', dep_dxheaders)
50endif
51
52if not meson.is_subproject() and get_option('build-test')
53 subdir('googletest')
54 subdir('test')
55endif
56
57pkg = import('pkgconfig')
58pkg.generate(name : 'DirectX-Headers',
59 description : 'Headers for using D3D12',
60 url: 'https://github.com/microsoft/DirectX-Headers',
61 libraries : [format_properties_lib, guids_lib],
62 version : meson.project_version(),
63 subdirs : install_inc_subdirs)
64install_subdir('include', install_dir : '')