Skip to content

Commit

Permalink
[build] Add version info to compiled DLLs
Browse files Browse the repository at this point in the history
Fixes #980.
  • Loading branch information
SveSop authored and doitsujin committed Apr 5, 2019
1 parent b896465 commit 4f9dd8d
Show file tree
Hide file tree
Showing 9 changed files with 202 additions and 5 deletions.
2 changes: 2 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ else
dxvk_library_path = meson.source_root() + '/lib32'
endif

wrc = cpu_family == 'x86_64' ? find_program('x86_64-w64-mingw32-windres') : find_program('i686-w64-mingw32-windres')

code = '''#ifndef __WINE__
#error 1
#endif'''
Expand Down
27 changes: 24 additions & 3 deletions src/d3d10/meson.build
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
d3d10_res = custom_target(
'version10.res',
input : 'version10.rc',
output : 'version10.o',
command : [ wrc, '@INPUT@', '@OUTPUT@' ],
)

d3d10_1_res = custom_target(
'version10_1.res',
input : 'version10_1.rc',
output : 'version10_1.o',
command : [ wrc, '@INPUT@', '@OUTPUT@' ],
)

d3d10_core_res = custom_target(
'version10_core.res',
input : 'version10_core.rc',
output : 'version10_core.o',
command : [ wrc, '@INPUT@', '@OUTPUT@' ],
)

d3d10_main_src = [
'd3d10_main.cpp',
'd3d10_reflection.cpp',
Expand All @@ -6,7 +27,7 @@ d3d10_main_src = [
d3d10_deps = [ lib_d3dcompiler_43, lib_dxgi ]
d3d10_deps += dxvk_winelib ? lib_d3d11 : d3d11_dep

d3d10_core_dll = shared_library('d3d10core'+dll_ext, d3d10_main_src,
d3d10_core_dll = shared_library('d3d10core'+dll_ext, d3d10_main_src, not dxvk_winelib ? d3d10_core_res : [],
name_prefix : '',
dependencies : [ d3d10_deps, dxbc_dep, dxvk_dep ],
include_directories : dxvk_include_path,
Expand All @@ -15,7 +36,7 @@ d3d10_core_dll = shared_library('d3d10core'+dll_ext, d3d10_main_src,
vs_module_defs : 'd3d10core'+def_spec_ext,
override_options : ['cpp_std='+dxvk_cpp_std])

d3d10_dll = shared_library('d3d10'+dll_ext, d3d10_main_src,
d3d10_dll = shared_library('d3d10'+dll_ext, d3d10_main_src, not dxvk_winelib ? d3d10_res : [],
name_prefix : '',
dependencies : [ d3d10_deps, dxbc_dep, dxvk_dep ],
include_directories : dxvk_include_path,
Expand All @@ -24,7 +45,7 @@ d3d10_dll = shared_library('d3d10'+dll_ext, d3d10_main_src,
vs_module_defs : 'd3d10'+def_spec_ext,
override_options : ['cpp_std='+dxvk_cpp_std])

d3d10_1_dll = shared_library('d3d10_1'+dll_ext, d3d10_main_src,
d3d10_1_dll = shared_library('d3d10_1'+dll_ext, d3d10_main_src, not dxvk_winelib ? d3d10_1_res : [],
name_prefix : '',
dependencies : [ d3d10_deps, dxbc_dep, dxvk_dep ],
include_directories : dxvk_include_path,
Expand Down
32 changes: 32 additions & 0 deletions src/d3d10/version10.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#include <windows.h>

// DLL version information.
VS_VERSION_INFO VERSIONINFO
FILEVERSION 10,0,17763,1
PRODUCTVERSION 10,0,17763,1
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "080904b0"
BEGIN
VALUE "CompanyName", "DXVK"
VALUE "FileDescription", "Direct3D 10 Runtime"
VALUE "FileVersion", "10.0.17763.1 (WinBuild.160101.0800)"
VALUE "InternalName", "D3D10.dll"
VALUE "LegalCopyright", "zlib/libpng license"
VALUE "OriginalFilename", "D3D10.dll"
VALUE "ProductName", "DXVK"
VALUE "ProductVersion", "10.0.17763.1"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0809, 1200
END
END

32 changes: 32 additions & 0 deletions src/d3d10/version10_1.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#include <windows.h>

// DLL version information.
VS_VERSION_INFO VERSIONINFO
FILEVERSION 10,0,17763,1
PRODUCTVERSION 10,0,17763,1
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "080904b0"
BEGIN
VALUE "CompanyName", "DXVK"
VALUE "FileDescription", "Direct3D 10.1 Runtime"
VALUE "FileVersion", "10.0.17763.1 (WinBuild.160101.0800)"
VALUE "InternalName", "D3D10_1.dll"
VALUE "LegalCopyright", "zlib/libpng license"
VALUE "OriginalFilename", "D3D10_1.dll"
VALUE "ProductName", "DXVK"
VALUE "ProductVersion", "10.0.17763.1"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0809, 1200
END
END

32 changes: 32 additions & 0 deletions src/d3d10/version10_core.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#include <windows.h>

// DLL version information.
VS_VERSION_INFO VERSIONINFO
FILEVERSION 10,0,17763,1
PRODUCTVERSION 10,0,17763,1
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "080904b0"
BEGIN
VALUE "CompanyName", "DXVK"
VALUE "FileDescription", "Direct3D 10 Runtime"
VALUE "FileVersion", "10.0.17763.1 (WinBuild.160101.0800)"
VALUE "InternalName", "D3D10Core.dll"
VALUE "LegalCopyright", "zlib/libpng license"
VALUE "OriginalFilename", "D3D10Core.dll"
VALUE "ProductName", "DXVK"
VALUE "ProductVersion", "10.0.17763.1"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0809, 1200
END
END

9 changes: 8 additions & 1 deletion src/d3d11/meson.build
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
d3d11_res = custom_target(
'version_11.res',
input : 'version.rc',
output : 'version.o',
command : [ wrc, '@INPUT@', '@OUTPUT@' ],
)

dxgi_common_src = [
'../dxgi/dxgi_format.cpp',
'../dxgi/dxgi_monitor.cpp',
Expand Down Expand Up @@ -54,7 +61,7 @@ d3d11_src = [
'd3d11_view_uav.cpp',
]

d3d11_dll = shared_library('d3d11'+dll_ext, dxgi_common_src + d3d11_src + d3d10_src, glsl_generator.process(dxgi_shaders),
d3d11_dll = shared_library('d3d11'+dll_ext, dxgi_common_src + d3d11_src + d3d10_src, glsl_generator.process(dxgi_shaders), not dxvk_winelib ? d3d11_res : [],
name_prefix : '',
dependencies : [ lib_dxgi, dxbc_dep, dxvk_dep ],
include_directories : dxvk_include_path,
Expand Down
32 changes: 32 additions & 0 deletions src/d3d11/version.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#include <windows.h>

// DLL version information.
VS_VERSION_INFO VERSIONINFO
FILEVERSION 10,0,17763,1
PRODUCTVERSION 10,0,17763,1
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "080904b0"
BEGIN
VALUE "CompanyName", "DXVK"
VALUE "FileDescription", "Direct3D 11 Runtime"
VALUE "FileVersion", "10.0.17763.1 (WinBuild.160101.0800)"
VALUE "InternalName", "D3D11.dll"
VALUE "LegalCopyright", "zlib/libpng license"
VALUE "OriginalFilename", "D3D11.dll"
VALUE "ProductName", "DXVK"
VALUE "ProductVersion", "10.0.17763.1"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0809, 1200
END
END

9 changes: 8 additions & 1 deletion src/dxgi/meson.build
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
dxgi_res = custom_target(
'version_dxgi.res',
input : 'version.rc',
output : 'version.o',
command : [ wrc, '@INPUT@', '@OUTPUT@' ],
)

dxgi_shaders = files([
'shaders/dxgi_presenter_frag.frag',
'shaders/dxgi_presenter_vert.vert',
Expand All @@ -15,7 +22,7 @@ dxgi_src = [
'dxgi_swapchain.cpp',
]

dxgi_dll = shared_library('dxgi'+dll_ext, dxgi_src,
dxgi_dll = shared_library('dxgi'+dll_ext, dxgi_src, not dxvk_winelib ? dxgi_res : [],
name_prefix : '',
dependencies : [ dxvk_dep ],
include_directories : dxvk_include_path,
Expand Down
32 changes: 32 additions & 0 deletions src/dxgi/version.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#include <windows.h>

// DLL version information.
VS_VERSION_INFO VERSIONINFO
FILEVERSION 10,0,17763,1
PRODUCTVERSION 10,0,17763,1
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "080904b0"
BEGIN
VALUE "CompanyName", "DXVK"
VALUE "FileDescription", "DirectX Graphics Infrastructure"
VALUE "FileVersion", "10.0.17763.1 (WinBuild.160101.0800)"
VALUE "InternalName", "dxgi.dll"
VALUE "LegalCopyright", "zlib/libpng license"
VALUE "OriginalFilename", "dxgi.dll"
VALUE "ProductName", "DXVK"
VALUE "ProductVersion", "10.0.17763.1"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0809, 1200
END
END

0 comments on commit 4f9dd8d

Please sign in to comment.