From 47865573a87ae662a3b435de3f2f78af1f4dc428 Mon Sep 17 00:00:00 2001 From: jackun Date: Sun, 18 Apr 2021 23:00:06 +0300 Subject: [PATCH] Add option to prepend libdir to library's path in vulkan manifest "\$LIB" technically breaks json but on the other hand vulkan loader currently doesn't handle "\\$LIB" Help with issue #468 --- meson_options.txt | 1 + src/meson.build | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/meson_options.txt b/meson_options.txt index 9bac7910..ad08f1a7 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -3,6 +3,7 @@ option('use_system_vulkan', type : 'feature', value : 'disabled', description: ' option('append_libdir_mangohud', type : 'boolean', value : true, description: 'Append "mangohud" to libdir path or not.') option('ld_libdir_prefix', type : 'boolean', value : false, description: 'Set ld libdir to "$prefix/lib/mangohud/\$LIB"') option('ld_libdir_abs', type : 'boolean', value : false, description: 'Use absolute path in LD_PRELOAD') +option('prepend_libdir_vk', type : 'boolean', value : true, description: 'Prepend libdir to library path in vulkan manifest') option('include_doc', type : 'boolean', value : true, description: 'Include the example config') option('with_nvml', type : 'combo', value : 'enabled', choices: ['enabled', 'system', 'disabled'], description: 'Enable NVML support') option('with_xnvctrl', type : 'feature', value : 'enabled', description: 'Enable XNVCtrl support') diff --git a/src/meson.build b/src/meson.build index b933c398..b7e31db9 100644 --- a/src/meson.build +++ b/src/meson.build @@ -25,6 +25,11 @@ else conf_data.set('ld_libdir_mangohud', ld_libdir_mangohud) endif +ld_libdir_mangohud_vk = '' +if get_option('prepend_libdir_vk') + ld_libdir_mangohud_vk = ld_libdir_mangohud +endif + overlay_shaders = [ 'overlay.frag', 'overlay.vert', @@ -207,7 +212,7 @@ endif configure_file(input : 'mangohud.json.in', output : '@0@.json'.format(meson.project_name()), - configuration : {'ld_libdir_mangohud' : ld_libdir_mangohud, + configuration : {'ld_libdir_mangohud' : ld_libdir_mangohud_vk, 'PROJECT_NAME' : meson.project_name().to_upper()}, install : true, install_dir : join_paths(get_option('datadir'), 'vulkan', 'implicit_layer.d'),