From 859948403282f50ac28c419162cc3048782761b8 Mon Sep 17 00:00:00 2001 From: FlightlessMango Date: Thu, 12 Mar 2020 08:24:37 +0100 Subject: [PATCH] configure .json files with meson --- meson.build | 2 +- src/mangohud.json.in | 4 ++-- src/meson.build | 25 ++++++++++++++++--------- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/meson.build b/meson.build index 78c1d568..d8a92817 100644 --- a/meson.build +++ b/meson.build @@ -18,7 +18,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -project('mangohud', +project('MangoHud', ['c', 'cpp'], version : 'v1.0.0', license : 'MIT', diff --git a/src/mangohud.json.in b/src/mangohud.json.in index 0ad12267..7330941d 100644 --- a/src/mangohud.json.in +++ b/src/mangohud.json.in @@ -1,10 +1,10 @@ { "file_format_version" : "1.0.0", "layer" : { - "name": "MangoHud", + "name": "@PROJECT_NAME@@LAYER_SUFFIX@", "type": "GLOBAL", "api_version": "1.1.125", - "library_path": "@libdir_mangohud@/libMangoHud.so", + "library_path": "@libdir_mangohud@libMangoHud.so", "implementation_version": "1", "description": "Vulkan Hud Overlay", "functions": { diff --git a/src/meson.build b/src/meson.build index c7434a99..f3c3405b 100644 --- a/src/meson.build +++ b/src/meson.build @@ -87,16 +87,23 @@ vklayer_mesa_overlay = shared_library( install : true ) -#configure_file(input : 'mangohud.json.in', -# output : 'mangohud.json', -# configuration : { 'libdir_mangohud' : libdir_mangohud }, -# install_dir : join_paths(get_option('datadir'), 'vulkan', 'implicit_layer.d'), -#) - -install_data( - files('mangohud.json'), +if get_option('using_build_sh') + configure_file(input : 'mangohud.json.in', + output : '@0@.json'.format(meson.project_name()), + configuration : {'PROJECT_NAME' : meson.project_name()}, + install : true, install_dir : join_paths(get_option('datadir'), 'vulkan', 'implicit_layer.d'), -) + ) +else + configure_file(input : 'mangohud.json.in', + output : '@0@.@1@.json'.format(meson.project_name(), target_machine.cpu_family()), + configuration : {'libdir_mangohud' : join_paths(get_option('prefix'), get_option('libdir'), 'mangohud'), + 'PROJECT_NAME' : meson.project_name() + ' ', + 'LAYER_SUFFIX' : target_machine.cpu_family()}, + install : true, + install_dir : join_paths(get_option('datadir'), 'vulkan', 'implicit_layer.d'), + ) +endif install_data( files('../bin/run-mangohud-gl-pkg.sh'),