Skip to content

Commit

Permalink
[build] Fix MSVC build with VS backend
Browse files Browse the repository at this point in the history
Fixes #115
  • Loading branch information
AlpyneDreams committed Mar 5, 2023
1 parent bcad6a4 commit 2c56a1a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
& "${Env:COMSPEC}" /s /c "`"${Env:VSDEVCMD}`" -arch=x86 -host_arch=x64 -no_logo && set" `
| % { , ($_ -Split '=', 2) } `
| % { [System.Environment]::SetEnvironmentVariable($_[0], $_[1]) }
meson -Denable_d3d11=false -Denable_d3d10=false -Denable_dxgi=false -Denable_d3d9=false -buildtype release --backend vs2022 build-msvc-x86
meson -Denable_d3d11=false -Denable_d3d10=false -Denable_dxgi=false -Denable_d3d9=false --buildtype release --backend vs2022 build-msvc-x86
msbuild -m build-msvc-x86/dxvk.sln
- name: Build MSVC x64
Expand Down
16 changes: 15 additions & 1 deletion src/d3d9/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,34 @@ d3d9_src = [

d3d9_ld_args = []
d3d9_link_depends = []
d3d9_objects = []

if platform != 'windows'
d3d9_ld_args += [ '-Wl,--version-script', join_paths(meson.current_source_dir(), 'd3d9.sym') ]
d3d9_link_depends += files('d3d9.sym')
endif

d3d9_lib = both_libraries('d3d9'+dll_ext, d3d9_src, glsl_generator.process(d3d9_shaders), d3d9_res,
if dxvk_is_msvc
# workaround for mesonbuild/meson#9235 on VS backend
d3d9_res = configure_file(
input : 'version.rc',
output : 'version.res',
command : [ wrc, '/fo', '@OUTPUT@', '@INPUT@' ],
)
d3d9_objects += d3d9_res
else
d3d9_src += d3d9_res
endif

d3d9_lib = both_libraries('d3d9'+dll_ext, d3d9_src, glsl_generator.process(d3d9_shaders),
name_prefix : dxvk_name_prefix,
dependencies : [ dxso_dep, dxvk_dep ],
include_directories : dxvk_include_path,
install : get_option('enable_d3d9'),
vs_module_defs : 'd3d9'+def_spec_ext,
link_args : d3d9_ld_args,
link_depends : [ d3d9_link_depends ],
objects : d3d9_objects
)

d3d9_dll = d3d9_lib.get_shared_lib()
Expand Down

0 comments on commit 2c56a1a

Please sign in to comment.