From 7632ffb1dac52347f14c2a4d1ced4776d6e28b7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sveinar=20S=C3=B8pler?= Date: Thu, 4 Apr 2019 18:10:57 +0200 Subject: [PATCH] Create fake_dll's with version info --- meson.build | 3 +- package-release.sh | 3 ++ src/d3d10/meson.build | 87 +++++++++++++++++++++++++++++++++---------- src/d3d11/meson.build | 27 +++++++++++--- src/dxgi/meson.build | 27 +++++++++++--- 5 files changed, 116 insertions(+), 31 deletions(-) diff --git a/meson.build b/meson.build index d78fe983f17..72a71567466 100644 --- a/meson.build +++ b/meson.build @@ -21,8 +21,10 @@ dxvk_include_path = include_directories('./include') if (cpu_family == 'x86_64') dxvk_library_path = meson.source_root() + '/lib' + target_arch = '-m64' else dxvk_library_path = meson.source_root() + '/lib32' + target_arch = '-m32' endif code = '''#ifndef __WINE__ @@ -42,7 +44,6 @@ if dxvk_winelib exe_ext = '.exe.so' dll_ext = '.dll' def_spec_ext = '.spec' - wrc = [ find_program('wrc'), '-i', '@INPUT@', '-o', '@OUTPUT@' ] else lib_vulkan = dxvk_compiler.find_library('vulkan-1', dirs : dxvk_library_path) lib_d3d11 = dxvk_compiler.find_library('d3d11') diff --git a/package-release.sh b/package-release.sh index 79c23d5655d..1be4655b1ec 100755 --- a/package-release.sh +++ b/package-release.sh @@ -71,6 +71,9 @@ function build_arch { rm "$DXVK_BUILD_DIR/x$1/"*.!(dll) fi rm -R "$DXVK_BUILD_DIR/build.$1" + if [ $opt_winelib -eq 1 ]; then + mv "$DXVK_BUILD_DIR/fakedlls" "$DXVK_BUILD_DIR/fakedlls$1" + fi fi } diff --git a/src/d3d10/meson.build b/src/d3d10/meson.build index e23d8015e1d..ade29358ba5 100644 --- a/src/d3d10/meson.build +++ b/src/d3d10/meson.build @@ -1,23 +1,46 @@ -d3d10_res = custom_target( - 'version10.res', - input : 'version10.rc', - output : 'version10.o', - command : wrc, -) - -d3d10_1_res = custom_target( - 'version10_1.res', - input : 'version10_1.rc', - output : 'version10_1.o', - command : wrc, -) - -d3d10_core_res = custom_target( - 'version10_core.res', - input : 'version10_core.rc', - output : 'version10_core.o', - command : wrc, -) +if dxvk_winelib + d3d10_res = custom_target('version_10.res', + input : 'version10.rc', + output : 'version10.res', + command : [ find_program('wrc'), '-o', '@OUTPUT@', '@INPUT@' ], + install : false, + ) + + d3d10_1_res = custom_target('version_1_10.res', + input : 'version10_1.rc', + output : 'version10_1.res', + command : [ find_program('wrc'), '-o', '@OUTPUT@', '@INPUT@' ], + install : false, + ) + + d3d10_core_res = custom_target('version10_core.res', + input : 'version10_core.rc', + output : 'version10_core.res', + command : [ find_program('wrc'), '-o', '@OUTPUT@', '@INPUT@' ], + install : false, + ) +else + d3d10_res = custom_target( + 'version10.res', + input : 'version10.rc', + output : 'version10.o', + command : wrc, + ) + + d3d10_1_res = custom_target( + 'version10_1.res', + input : 'version10_1.rc', + output : 'version10_1.o', + command : wrc, + ) + + d3d10_core_res = custom_target( + 'version10_core.res', + input : 'version10_core.rc', + output : 'version10_core.o', + command : wrc, + ) +endif d3d10_main_src = [ 'd3d10_main.cpp', @@ -54,6 +77,30 @@ d3d10_1_dll = shared_library('d3d10_1'+dll_ext, d3d10_main_src, not dxvk_winelib vs_module_defs : 'd3d10_1'+def_spec_ext, override_options : ['cpp_std='+dxvk_cpp_std]) +if dxvk_winelib + d3d10_dll_target = custom_target('d3d10.dll', + output : 'd3d10.dll', + input : [ 'd3d10.spec', d3d10_res ], + command : [ find_program('winebuild'), target_arch, '--dll', '--fake-module', '-E', '@INPUT@', '-o', '@OUTPUT@', '-F', 'd3d10.dll' ], + install : true, + install_dir : 'fakedlls') + + d3d10_1_dll_target = custom_target('d3d10_1.dll', + output : 'd3d10_1.dll', + input : [ 'd3d10_1.spec', d3d10_1_res ], + command : [ find_program('winebuild'), target_arch, '--dll', '--fake-module', '-E', '@INPUT@', '-o', '@OUTPUT@', '-F', 'd3d10_1.dll' ], + install : true, + install_dir : 'fakedlls') + + d3d10_core_dll_target = custom_target('d3d10core.dll', + output : 'd3d10core.dll', + input : [ 'd3d10core.spec', d3d10_core_res ], + command : [ find_program('winebuild'), target_arch, '--dll', '--fake-module', '-E', '@INPUT@', '-o', '@OUTPUT@', '-F', 'd3d10core.dll' ], + install : true, + install_dir : 'fakedlls') +endif + + d3d10_dep = declare_dependency( link_with : [ d3d10_dll, d3d10_1_dll, d3d10_core_dll ], include_directories : [ dxvk_include_path ]) diff --git a/src/d3d11/meson.build b/src/d3d11/meson.build index 90c16985ca4..ea8d352ca34 100644 --- a/src/d3d11/meson.build +++ b/src/d3d11/meson.build @@ -1,9 +1,17 @@ -d3d11_res = custom_target( - 'version_11.res', +if dxvk_winelib + d3d11_res = custom_target('version_11.res', input : 'version.rc', - output : 'version.o', - command : wrc, -) + output : 'version.res', + command : [ find_program('wrc'), '-o', '@OUTPUT@', '@INPUT@' ], + install : false) +else + d3d11_res = custom_target( + 'version_11.res', + input : 'version.rc', + output : 'version.o', + command : wrc, + ) +endif dxgi_common_src = [ '../dxgi/dxgi_format.cpp', @@ -70,6 +78,15 @@ d3d11_dll = shared_library('d3d11'+dll_ext, dxgi_common_src + d3d11_src + d3d10_ vs_module_defs : 'd3d11'+def_spec_ext, override_options : ['cpp_std='+dxvk_cpp_std]) +if dxvk_winelib + d3d11_dll_target = custom_target('d3d11.dll', + output : 'd3d11.dll', + input : [ 'd3d11.spec', d3d11_res ], + command : [ find_program('winebuild'), target_arch, '--dll', '--fake-module', '-E', '@INPUT@', '-o', '@OUTPUT@', '-F', 'd3d11.dll' ], + install : true, + install_dir : 'fakedlls') +endif + d3d11_dep = declare_dependency( link_with : [ d3d11_dll ], include_directories : [ dxvk_include_path ]) diff --git a/src/dxgi/meson.build b/src/dxgi/meson.build index 1d200effe87..9e924cb0026 100644 --- a/src/dxgi/meson.build +++ b/src/dxgi/meson.build @@ -1,9 +1,17 @@ -dxgi_res = custom_target( - 'version_dxgi.res', +if dxvk_winelib + dxgi_res = custom_target('dxgi.res', input : 'version.rc', - output : 'version.o', - command : wrc, -) + output : 'version.res', + command : [ find_program('wrc'), '-o', '@OUTPUT@', '@INPUT@' ], + install : false) +else + dxgi_res = custom_target( + 'version_dxgi.res', + input : 'version.rc', + output : 'version.o', + command : wrc, + ) +endif dxgi_shaders = files([ 'shaders/dxgi_presenter_frag.frag', @@ -31,6 +39,15 @@ dxgi_dll = shared_library('dxgi'+dll_ext, dxgi_src, not dxvk_winelib ? dxgi_res objects : not dxvk_msvc ? 'dxgi'+def_spec_ext : [], override_options : ['cpp_std='+dxvk_cpp_std]) +if dxvk_winelib + dxgi_dll_target = custom_target('dxgi.dll', + output : 'dxgi.dll', + input : [ 'dxgi.spec', dxgi_res ], + command : [ find_program('winebuild'), target_arch, '--dll', '--fake-module', '-E', '@INPUT@', '-o', '@OUTPUT@', '-F', 'dxgi.dll' ], + install : true, + install_dir : 'fakedlls') +endif + dxgi_dep = declare_dependency( link_with : [ dxgi_dll ], include_directories : [ dxvk_include_path ])