Skip to content

Commit

Permalink
[build] Generate pkg-config metadata to link to DXVK libraries
Browse files Browse the repository at this point in the history
This allows dependent projects to query the version and location of DXVK
via the pkg-config interface.

The include directories aren't yet set, because the headers aren't
installed; that will follow in a subsequent commit.

The naming of these pkg-config files is based on proposed Fedora packages
for DXVK 2.0, and is not compatible with older Fedora packages for DXVK
1.x (which used the naming convention dxvk-native-d3d9 and so on).
Packagers can create symlinks such as dxvk-native-d3d9.pc -> dxvk-d3d9.pc
if they want to retain compatibility with older names.

Signed-off-by: Simon McVittie <[email protected]>
  • Loading branch information
smcv authored and misyltoad committed May 21, 2024
1 parent f9b4046 commit 2ff2c82
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
project('dxvk', ['c', 'cpp'], version : 'v2.3.1', meson_version : '>= 0.58', default_options : [ 'cpp_std=c++17', 'warning_level=2' ])

pkg = import('pkgconfig')
cpu_family = target_machine.cpu_family()
platform = target_machine.system()
fs = import('fs')
Expand Down Expand Up @@ -146,6 +147,7 @@ else
endif

dxvk_name_prefix = 'dxvk_'
dxvk_pkg_prefix = 'dxvk-'

link_args += [
'-static-libgcc',
Expand Down
7 changes: 7 additions & 0 deletions src/d3d10/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,10 @@ d3d10_core_dll = shared_library(dxvk_name_prefix+'d3d10core', d3d10_core_src, d3
d3d10_core_dep = declare_dependency(
link_with : [ d3d10_core_dll ],
)

if platform != 'windows'
pkg.generate(d3d10_core_dll,
filebase: dxvk_pkg_prefix + 'd3d10core',
subdirs: 'dxvk',
)
endif
7 changes: 7 additions & 0 deletions src/d3d11/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,10 @@ d3d11_dep = declare_dependency(
link_with : [ d3d11_dll ],
include_directories : [ dxvk_include_path ],
)

if platform != 'windows'
pkg.generate(d3d11_dll,
filebase: dxvk_pkg_prefix + 'd3d11',
subdirs: 'dxvk',
)
endif
7 changes: 7 additions & 0 deletions src/d3d9/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,10 @@ d3d9_dep = declare_dependency(
link_with : [ d3d9_dll ],
include_directories : [ dxvk_include_path ],
)

if platform != 'windows'
pkg.generate(d3d9_dll,
filebase: dxvk_pkg_prefix + 'd3d9',
subdirs: 'dxvk',
)
endif
7 changes: 7 additions & 0 deletions src/dxgi/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,10 @@ dxgi_dep = declare_dependency(
link_with : [ dxgi_dll ],
include_directories : [ dxvk_include_path ],
)

if platform != 'windows'
pkg.generate(dxgi_dll,
filebase: dxvk_pkg_prefix + 'dxgi',
subdirs: 'dxvk',
)
endif

0 comments on commit 2ff2c82

Please sign in to comment.