Skip to content

Commit

Permalink
Create fake_dll's with version info
Browse files Browse the repository at this point in the history
  • Loading branch information
SveSop committed Apr 4, 2019
1 parent 95c6036 commit 7632ffb
Show file tree
Hide file tree
Showing 5 changed files with 116 additions and 31 deletions.
3 changes: 2 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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__
Expand All @@ -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')
Expand Down
3 changes: 3 additions & 0 deletions package-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
87 changes: 67 additions & 20 deletions src/d3d10/meson.build
Original file line number Diff line number Diff line change
@@ -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',
Expand Down Expand Up @@ -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 ])
27 changes: 22 additions & 5 deletions src/d3d11/meson.build
Original file line number Diff line number Diff line change
@@ -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',
Expand Down Expand Up @@ -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 ])
27 changes: 22 additions & 5 deletions src/dxgi/meson.build
Original file line number Diff line number Diff line change
@@ -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',
Expand Down Expand Up @@ -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 ])

0 comments on commit 7632ffb

Please sign in to comment.