Line 0
Link Here
|
|
|
1 |
diff --git a/meson.build b/meson.build |
2 |
index 0744ba1..95c09c3 100644 |
3 |
--- a/meson.build |
4 |
+++ b/meson.build |
5 |
@@ -138,18 +138,12 @@ if host_machine.system() == 'windows' and not python3_dep.found() |
6 |
endif |
7 |
|
8 |
pygobject_dep = dependency('pygobject-3.0', version: pygobject_req, required: false) |
9 |
-lua51_dep = dependency('lua51', version: lua_req, required: false) |
10 |
-if not lua51_dep.found() |
11 |
- lua51_dep = dependency('lua-5.1', version: lua_req, required: false) |
12 |
-endif |
13 |
-luajit_dep = dependency('luajit', version: luajit_req, required: false) |
14 |
+lua51_dep = dependency('lua', version: lua_req, required: get_option('lua51')) |
15 |
+luajit_dep = dependency('luajit', version: luajit_req, required: get_option('luajit')) |
16 |
lua_lgi_found = false |
17 |
lua_lgi_ver = 'not found' |
18 |
-lua51_prg = find_program('lua5.1', required: false) |
19 |
-if not lua51_prg.found() |
20 |
- lua51_prg = find_program('lua51', required: false) |
21 |
-endif |
22 |
-luajit_prg = find_program('luajit', required: false) |
23 |
+lua51_prg = find_program('lua', required: get_option('lua51')) |
24 |
+luajit_prg = find_program('luajit', required: get_option('luajit')) |
25 |
xmllint_prg = find_program('xmllint', required: false) |
26 |
generate_vapi = get_option('vapi') |
27 |
vapigen_prg = find_program('vapigen', required: generate_vapi) |
28 |
@@ -211,6 +205,8 @@ if lua_found |
29 |
lua51_lgi_dep = declare_dependency(version: lua_lgi_ver) |
30 |
lua_lgi_found = true |
31 |
endif |
32 |
+ else |
33 |
+ error('lua support requested but lua-lgi not found') |
34 |
endif |
35 |
message('lua-lgi version: ' + lua_lgi_ver) |
36 |
endif |
37 |
@@ -394,11 +390,7 @@ endif |
38 |
|
39 |
build_gjs_loader = get_option('gjs') |
40 |
|
41 |
-build_lua51_loader = get_option('lua51') |
42 |
-lua51_found = (luajit_dep.found() or lua51_dep.found()) and lua_lgi_found |
43 |
-if build_lua51_loader and not lua51_found |
44 |
- error('Lua51 requested but failed to locate suitable Lua51 and LGI support') |
45 |
-endif |
46 |
+build_lua51_loader = (luajit_dep.found() or lua51_dep.found()) and lua_lgi_found |
47 |
|
48 |
build_python3_loader = get_option('python3') |
49 |
python3_found = python3_dep.found() and pygobject_dep.found() |
50 |
diff --git a/meson_options.txt b/meson_options.txt |
51 |
index 48a7e8d..891bf2a 100644 |
52 |
--- a/meson_options.txt |
53 |
+++ b/meson_options.txt |
54 |
@@ -3,9 +3,13 @@ option('gjs', |
55 |
description: 'Enable GJS support (requires gjs-1.0)') |
56 |
|
57 |
option('lua51', |
58 |
- type: 'boolean', value: true, |
59 |
+ type: 'feature', value: 'enabled', |
60 |
description: 'Enable Lua 5.1 support (requires lua-lgi)') |
61 |
|
62 |
+option('luajit', |
63 |
+ type: 'feature', value: 'disabled', |
64 |
+ description: 'Use LuaJIT for Lua 5.1 support (requires lua-lgi)') |
65 |
+ |
66 |
option('python3', |
67 |
type: 'boolean', value: true, |
68 |
description: 'Enable Python 3 support (requires pygobject)') |