Skip to content

Commit

Permalink
layer: Specify project and Meson versions, make paths configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
Saancreed committed Jan 6, 2025
1 parent 89b6797 commit eaa7caa
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 11 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/build-llvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,13 @@ jobs:
--cross-file ./build-win64-llvm.txt \
--buildtype release \
--prefix ~+/install/bin/layer \
--strip
--bindir '' \
--strip \
-Dabsolute_library_path=false \
-Dlibrary_path_prefix=./ \
-Dmanifest_install_dir=.
ninja -C build/layer install
rm -R install/bin/layer/lib
- name: Upload artifact
uses: actions/upload-artifact@v4
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/build-test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,14 @@ jobs:
& "${Env:COMSPEC}" /s /c "`"${Env:VSDEVCMD}`" -arch=x64 -host_arch=x64 -no_logo && set" `
| % { , ($_ -Split '=', 2) } `
| % { [System.Environment]::SetEnvironmentVariable($_[0], $_[1]) }
meson setup --buildtype release --backend vs2022 build-msvc-layer layer -Dcpp_args=/Zc:preprocessor
meson setup `
--buildtype release `
--backend vs2022 `
'-Dcpp_args=/Zc:preprocessor' `
'-Dabsolute_library_path=false' `
'-Dlibrary_path_prefix=./' `
'-Dmanifest_install_dir=.' `
build-msvc-layer layer
msbuild -m build-msvc-layer\dxvk-nvapi-vkreflex-layer.sln
- name: Upload artifact
Expand Down
2 changes: 1 addition & 1 deletion layer/VkLayer_DXVK_NVAPI_reflex.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "VK_LAYER_DXVK_NVAPI_reflex",
"type": "GLOBAL",
"api_version": "1.3.295",
"library_path": "@vkreflex_library_name@",
"library_path": "@library_path_prefix@@vkreflex_library_name@",
"library_arch": "64",
"implementation_version": "1",
"description": "DXVK-NVAPI Vulkan Reflex compatibility layer",
Expand Down
15 changes: 12 additions & 3 deletions layer/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
project('dxvk-nvapi-vkreflex-layer', ['cpp'], default_options: ['cpp_std=c++20'])
project(
'dxvk-nvapi-vkreflex-layer',
['cpp'],
default_options: ['cpp_std=c++20'],
version: 'v0.8.0',
meson_version: '>= 1.1',
)

version = vcs_tag(
command: ['git', 'describe', '--always', '--tags', '--dirty=+'],
Expand Down Expand Up @@ -32,9 +38,12 @@ vkreflex_layer = shared_library(
fs = import('fs')

configure_file(
configuration: {'vkreflex_library_name': fs.name(vkreflex_layer.full_path())},
configuration: {
'library_path_prefix': get_option('absolute_library_path') ? (fs.as_posix(get_option('prefix') / get_option('libdir')) + '/') : get_option('library_path_prefix'),
'vkreflex_library_name': fs.name(vkreflex_layer.full_path()),
},
input: 'VkLayer_DXVK_NVAPI_reflex.json.in',
output: 'VkLayer_DXVK_NVAPI_reflex.json',
install: true,
install_dir: 'share/vulkan/implicit_layer.d',
install_dir: get_option('manifest_install_dir'),
)
20 changes: 20 additions & 0 deletions layer/meson.options
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
option(
'absolute_library_path',
type: 'boolean',
value: true,
description: 'Prepend full install dir to library_path in the layer manifest',
)

option(
'library_path_prefix',
type: 'string',
value: '',
description: 'Custom prefix to prepend to library_path in the layer manifest, ignored when absolute_library_path is set to true',
)

option(
'manifest_install_dir',
type: 'string',
value: 'share/vulkan/implicit_layer.d',
description: 'Path to directory where the layer manifest should be installed',
)
14 changes: 9 additions & 5 deletions package-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,15 @@ function build_layer {
# files get into the build instead of the generated ones
rm -f "$SRC_DIR"/layer/{version,config}.h

meson setup \
--buildtype "release" \
--prefix "$BUILD_DIR/layer" \
--strip \
"$BUILD_DIR/build.layer" \
meson setup \
--buildtype "release" \
--prefix "$BUILD_DIR/layer" \
--libdir '' \
--strip \
-Dabsolute_library_path=false \
-Dlibrary_path_prefix=./ \
-Dmanifest_install_dir=. \
"$BUILD_DIR/build.layer" \
"$SRC_DIR/layer"

ninja -C "$BUILD_DIR/build.layer" install
Expand Down

0 comments on commit eaa7caa

Please sign in to comment.