summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Thomsen <oss@cogitri.dev>2020-05-19 10:11:49 +0200
committerTimo Teräs <timo.teras@iki.fi>2020-10-02 12:07:05 +0300
commita904939a43bf43289345321da68b743e0d9ea804 (patch)
tree5a4a9530fe498aef1969340a7b053636fe1c06d3
parent111835e860034fe10d7351b3056aff851057fe2b (diff)
downloadapk-tools-a904939a43bf43289345321da68b743e0d9ea804.tar.gz
apk-tools-a904939a43bf43289345321da68b743e0d9ea804.tar.bz2
apk-tools-a904939a43bf43289345321da68b743e0d9ea804.tar.xz
apk-tools-a904939a43bf43289345321da68b743e0d9ea804.zip
build: allow building without help in meson
-rw-r--r--meson.build1
-rw-r--r--meson_options.txt1
-rw-r--r--src/meson.build25
3 files changed, 19 insertions, 8 deletions
diff --git a/meson.build b/meson.build
index d348ad5..4aaf5c5 100644
--- a/meson.build
+++ b/meson.build
@@ -12,6 +12,7 @@ apk_libdir = get_option('libdir')
zlib_dep = dependency('zlib')
openssl_dep = dependency('openssl')
+lua_bin = find_program('lua' + get_option('lua_version'), required: get_option('help'))
lua_dep = dependency('lua' + get_option('lua_version'), required: get_option('lua'))
scdoc_dep = dependency('scdoc', version: '>=1.10', required: get_option('docs'))
diff --git a/meson_options.txt b/meson_options.txt
index 8ea72c7..5d04e51 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,3 +1,4 @@
option('docs', description: 'Build manpages with scdoc', type: 'feature', value: 'auto')
+option('help', description: 'Build help into apk binaries, needs lua and lua-zlib', type: 'feature', value: 'auto')
option('lua', description: 'Build luaapk (lua bindings)', type: 'feature', value: 'auto')
option('lua_version', description: 'Lua version to build against', type: 'string', value: '5.3')
diff --git a/src/meson.build b/src/meson.build
index 972e4b4..07beac7 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -54,15 +54,24 @@ apk_src = [
'help.c',
]
-genhelp_script = find_program('genhelp.lua')
+if lua_bin.found()
+ genhelp_script = find_program('genhelp.lua')
-generated_help = custom_target(
- 'help.h',
- capture: true,
- output: 'help.h',
- input: man_files,
- command: [genhelp_script, '@INPUT@'],
-)
+ generated_help = custom_target(
+ 'help.h',
+ capture: true,
+ output: 'help.h',
+ input: man_files,
+ command: [genhelp_script, '@INPUT@'],
+ )
+else
+ generated_help = custom_target(
+ 'help.h',
+ capture: true,
+ output: 'help.h',
+ command: ['echo', '#define NO_HELP'],
+ )
+endif
apk_src += [ generated_help ]