From 112e371a9b952414c3747b225619114f47f15f69 Mon Sep 17 00:00:00 2001 From: Jarcode Date: Mon, 9 Sep 2019 14:23:52 -0700 Subject: [PATCH] Handle selecting lua implementation in meson.build --- meson.build | 16 +++++++++++++--- meson_options.txt | 8 ++++++-- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index 98b91c1..46fd8a1 100644 --- a/meson.build +++ b/meson.build @@ -25,7 +25,7 @@ glava_dependencies = [ ] if cc.get_id() == 'clang' - add_project_arguments('-fblocks', language: 'c') + add_project_arguments('-fblocks', language: 'c') glava_dependencies += cc.find_library('BlocksRuntime') endif @@ -109,18 +109,28 @@ if not get_option('disable_config') ).stdout().strip().split('\n') glava_config_lua_targets += s + '.' + luac_output_ext endforeach + + luac_name = 'luac' + get_option('lua_version') + luac_impl = get_option('lua_implementation') + if get_option('lua_implementation') == 'luajit' + luac_name = 'luajit' + luac_impl += '-' + endif luac_target = custom_target( 'glava-config-luac', input: generator( - find_program('luac'), + find_program(luac_name), output: '@BASENAME@.' + luac_output_ext, arguments: ['-o', '@OUTPUT@', '@INPUT@']).process(glava_config_lua_sources), output: glava_config_lua_targets, command: [find_program('cp'), '-t', '@OUTDIR@', '@INPUT@'], build_by_default: true, install: true, - install_dir: get_option('lua_install_dir') + '/glava-config') + install_dir: get_option('lua_install_dir') + '/' + + get_option('lua_implementation') + '/' + + get_option('lua_version') + '/' + + 'glava-config') executable( 'glava-config', diff --git a/meson_options.txt b/meson_options.txt index 36fcdd8..2c1d456 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -12,8 +12,12 @@ option('disable_config', type: 'boolean', value: true, description: 'Skip building GLava GTK+ configuration tool') option('shader_install_dir', type: 'string', value: '/etc/xdg', description: 'GLSL config/module system install directory') -option('lua_install_dir', type: 'string', value: '/usr/share/lua/5.3', - description: 'Location to install Lua 5.3 modules for glava-config') +option('lua_install_dir', type: 'string', value: '/usr/share', + description: 'Location to install Lua modules for glava-config') +option('lua_version', type: 'string', value: '5.3', + description: 'Lua version to use for glava-config') +option('lua_implementation', type: 'string', value: 'lua', + description: 'Lua implementation to use (\'lua\' or \'luajit\')') option('resource_install_dir', type: 'string', value: '/usr/share/glava', description: 'Location to install generic GLava resources') option('obs_plugin_install_dir', type: 'string', value: '/usr/lib/obs-plugins',