From cfc51ec99f24048ce221aa9fc0fb1dbe8c99aa89 Mon Sep 17 00:00:00 2001 From: John Zimmermann Date: Thu, 28 Sep 2023 18:17:37 +0200 Subject: [PATCH] meson: allow setting absolute path instead of 'Dynamic string tokens' resolves #601 --- meson_options.txt | 1 + src/meson.build | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/meson_options.txt b/meson_options.txt index a45dca8e..c82ae158 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -13,3 +13,4 @@ option('mangohudctl', type: 'boolean', value : false) option('mangoapp_layer', type: 'boolean', value : false) option('tests', type: 'feature', value: 'auto', description: 'Run tests') option('mangoplot', type: 'feature', value: 'enabled') +option('dynamic_string_tokens', type: 'boolean', value: true, description: 'Use dynamic string tokens in LD_PRELOAD') diff --git a/src/meson.build b/src/meson.build index b1059832..39396d1b 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,12 +1,18 @@ glslang = find_program('glslang', 'glslangValidator') +if get_option('dynamic_string_tokens') + ld_prefix = get_option('prefix') + '/\$LIB/' +else + ld_prefix = join_paths(get_option('prefix') ,get_option('libdir')) + '/' +endif + # Needs prefix for configure_file() if get_option('append_libdir_mangohud') libdir_mangohud = join_paths(get_option('prefix'), get_option('libdir'), 'mangohud') - ld_libdir_mangohud = get_option('prefix') + '/\$LIB/mangohud/' + ld_libdir_mangohud = ld_prefix + 'mangohud/' else libdir_mangohud = join_paths(get_option('prefix'), get_option('libdir')) - ld_libdir_mangohud = get_option('prefix') + '/\$LIB/' + ld_libdir_mangohud = ld_prefix endif git = find_program('git', required: false)