2019-01-04 11:46:08 +01:00
|
|
|
project('dxvk', ['c', 'cpp'], version : 'v0.94', meson_version : '>= 0.43')
|
2017-10-10 23:32:13 +02:00
|
|
|
|
2017-12-12 12:50:52 +01:00
|
|
|
cpu_family = target_machine.cpu_family()
|
|
|
|
|
2018-07-18 00:53:36 +02:00
|
|
|
add_project_arguments('-DNOMINMAX', language : 'cpp')
|
|
|
|
|
2017-10-10 23:32:13 +02:00
|
|
|
dxvk_compiler = meson.get_compiler('cpp')
|
2018-03-06 18:34:34 +01:00
|
|
|
if dxvk_compiler.get_id() == 'msvc'
|
|
|
|
dxvk_cpp_std='c++latest'
|
2018-07-21 12:43:33 +02:00
|
|
|
dxvk_msvc=true
|
2018-03-06 18:34:34 +01:00
|
|
|
else
|
|
|
|
dxvk_cpp_std='c++1z'
|
2018-07-21 12:43:33 +02:00
|
|
|
dxvk_msvc=false
|
2018-03-06 18:34:34 +01:00
|
|
|
endif
|
|
|
|
|
2018-04-19 11:47:17 +02:00
|
|
|
if dxvk_compiler.get_id() == 'msvc'
|
2018-08-13 18:30:51 +02:00
|
|
|
add_project_arguments('/std:' + dxvk_cpp_std, language : 'cpp')
|
2018-04-19 11:47:17 +02:00
|
|
|
endif
|
|
|
|
|
2017-10-10 23:32:13 +02:00
|
|
|
dxvk_include_path = include_directories('./include')
|
|
|
|
|
2017-12-12 12:50:52 +01:00
|
|
|
if (cpu_family == 'x86_64')
|
|
|
|
dxvk_library_path = meson.source_root() + '/lib'
|
|
|
|
else
|
|
|
|
dxvk_library_path = meson.source_root() + '/lib32'
|
|
|
|
endif
|
|
|
|
|
2018-11-04 16:18:32 +01:00
|
|
|
code = '''#ifndef __WINE__
|
|
|
|
#error 1
|
|
|
|
#endif'''
|
|
|
|
|
|
|
|
dxvk_winelib = dxvk_compiler.compiles(code, name: 'winelib check')
|
2018-11-05 07:55:36 +01:00
|
|
|
dxvk_extradep = [ ]
|
2018-11-04 16:18:32 +01:00
|
|
|
|
|
|
|
if dxvk_winelib
|
2018-08-17 19:55:37 +02:00
|
|
|
lib_vulkan = declare_dependency(link_args: [ '-lwinevulkan' ])
|
2018-07-18 01:00:07 +02:00
|
|
|
lib_d3d11 = declare_dependency(link_args: [ '-ld3d11' ])
|
|
|
|
lib_dxgi = declare_dependency(link_args: [ '-ldxgi' ])
|
2018-08-15 21:52:44 +02:00
|
|
|
lib_d3dcompiler_43 = declare_dependency(link_args: [ '-L'+dxvk_library_path, '-ld3dcompiler_43' ])
|
2018-08-27 14:11:54 +02:00
|
|
|
lib_d3dcompiler_47 = declare_dependency(link_args: [ '-ld3dcompiler' ])
|
2018-11-05 07:55:36 +01:00
|
|
|
dxvk_extradep += [ declare_dependency(link_args: [ '-ldl' ]) ]
|
2018-07-18 01:29:10 +02:00
|
|
|
exe_ext = '.exe.so'
|
|
|
|
dll_ext = '.dll'
|
2018-07-15 19:13:05 +02:00
|
|
|
def_spec_ext = '.spec'
|
2018-07-18 01:00:07 +02:00
|
|
|
else
|
|
|
|
lib_vulkan = dxvk_compiler.find_library('vulkan-1', dirs : dxvk_library_path)
|
|
|
|
lib_d3d11 = dxvk_compiler.find_library('d3d11')
|
|
|
|
lib_dxgi = dxvk_compiler.find_library('dxgi')
|
2018-08-15 21:52:44 +02:00
|
|
|
lib_d3dcompiler_43 = dxvk_compiler.find_library('d3dcompiler_43', dirs : dxvk_library_path)
|
|
|
|
|
|
|
|
if dxvk_compiler.get_id() == 'msvc'
|
|
|
|
lib_d3dcompiler_47 = dxvk_compiler.find_library('d3dcompiler')
|
|
|
|
else
|
|
|
|
lib_d3dcompiler_47 = dxvk_compiler.find_library('d3dcompiler_47')
|
|
|
|
endif
|
2018-07-18 01:29:10 +02:00
|
|
|
exe_ext = ''
|
|
|
|
dll_ext = ''
|
2018-07-15 19:13:05 +02:00
|
|
|
def_spec_ext = '.def'
|
2018-03-06 18:34:34 +01:00
|
|
|
endif
|
2017-12-12 12:50:52 +01:00
|
|
|
|
2018-01-13 03:53:33 +01:00
|
|
|
glsl_compiler = find_program('glslangValidator')
|
|
|
|
glsl_generator = generator(glsl_compiler,
|
|
|
|
output : [ '@BASENAME@.h' ],
|
|
|
|
arguments : [ '-V', '--vn', '@BASENAME@', '@INPUT@', '-o', '@OUTPUT@' ])
|
|
|
|
|
2018-07-11 19:26:45 +02:00
|
|
|
dxvk_version = vcs_tag(
|
2018-09-30 22:19:05 +02:00
|
|
|
command: ['git', 'describe', '--dirty=+'],
|
2018-07-11 17:24:30 +02:00
|
|
|
input: 'version.h.in',
|
|
|
|
output: 'version.h')
|
|
|
|
|
2017-10-10 23:32:13 +02:00
|
|
|
subdir('src')
|
2018-03-14 20:38:38 +01:00
|
|
|
|
|
|
|
enable_tests = get_option('enable_tests')
|
|
|
|
|
|
|
|
if enable_tests
|
2018-03-06 18:34:34 +01:00
|
|
|
subdir('tests')
|
2018-03-14 20:38:38 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
if dxvk_compiler.get_id() != 'msvc'
|
2018-08-17 11:20:31 +02:00
|
|
|
subdir('utils')
|
2018-03-06 18:34:34 +01:00
|
|
|
endif
|