diff options
| author | 3gg <3gg@shellblade.net> | 2025-12-02 16:39:36 -0800 |
|---|---|---|
| committer | 3gg <3gg@shellblade.net> | 2025-12-02 16:39:36 -0800 |
| commit | 6c8ae19be66cee247980a48e736a4e05d14de179 (patch) | |
| tree | d860767907bf0cbe17ec66422e11bea700cf56d9 /contrib/DirectX-Headers-1.618.2/meson.build | |
| parent | 8f594c8ebd11f0e5f8a0c6369c3fe7383d250cbe (diff) | |
Diffstat (limited to 'contrib/DirectX-Headers-1.618.2/meson.build')
| -rw-r--r-- | contrib/DirectX-Headers-1.618.2/meson.build | 64 |
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 | |||
| 4 | project('DirectX-Headers', 'cpp', version : '1.618.2', | ||
| 5 | default_options : ['cpp_std=c++14']) | ||
| 6 | |||
| 7 | cpp = meson.get_compiler('cpp') | ||
| 8 | compiler_id = cpp.get_id() | ||
| 9 | #d3d12_lib is not available in linux | ||
| 10 | d3d12_lib = cpp.find_library('d3d12', required : host_machine.system() == 'windows') | ||
| 11 | #dxcore is not available in Mingw-w64 | ||
| 12 | dxcore_lib = cpp.find_library('dxcore', required: compiler_id == 'msvc') | ||
| 13 | test_compile_opts = [] | ||
| 14 | if host_machine.system() == 'windows' | ||
| 15 | test_compile_opts = ['-DUNICODE', '-D_WIN32_WINNT=0x0A00'] | ||
| 16 | endif | ||
| 17 | if (compiler_id == 'gcc') or (compiler_id == 'clang') | ||
| 18 | test_compile_opts += ['-Wno-unused-variable'] | ||
| 19 | endif | ||
| 20 | |||
| 21 | inc_dirs = [include_directories('include', is_system : true)] | ||
| 22 | install_inc_subdirs = [''] | ||
| 23 | compile_options = [] | ||
| 24 | |||
| 25 | if host_machine.system() != 'windows' | ||
| 26 | inc_dirs += include_directories('include/wsl/stubs', is_system : true) | ||
| 27 | install_inc_subdirs += ['', 'wsl/stubs', 'directx'] | ||
| 28 | elif 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'] | ||
| 33 | endif | ||
| 34 | |||
| 35 | format_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) | ||
| 41 | guids_lib = static_library('DirectX-Guids', 'src/dxguids.cpp', include_directories : inc_dirs, install : true) | ||
| 42 | |||
| 43 | dep_dxheaders = declare_dependency( | ||
| 44 | link_with : [format_properties_lib, guids_lib], | ||
| 45 | include_directories : inc_dirs, | ||
| 46 | compile_args : compile_options) | ||
| 47 | |||
| 48 | if meson.version().version_compare('>=0.54.0') | ||
| 49 | meson.override_dependency('DirectX-Headers', dep_dxheaders) | ||
| 50 | endif | ||
| 51 | |||
| 52 | if not meson.is_subproject() and get_option('build-test') | ||
| 53 | subdir('googletest') | ||
| 54 | subdir('test') | ||
| 55 | endif | ||
| 56 | |||
| 57 | pkg = import('pkgconfig') | ||
| 58 | pkg.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) | ||
| 64 | install_subdir('include', install_dir : '') | ||
