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-09 16:09:19 +0300
commitf6795011cab8da4fbf8e719f71d2028de1ca389e (patch)
tree657a4539446b54b81c7b859bacc3055887eed6b2
parent718e07f78a6f5a5a1c5c1a961308bd85afb4db30 (diff)
downloadapk-tools-f6795011cab8da4fbf8e719f71d2028de1ca389e.tar.gz
apk-tools-f6795011cab8da4fbf8e719f71d2028de1ca389e.tar.bz2
apk-tools-f6795011cab8da4fbf8e719f71d2028de1ca389e.tar.xz
apk-tools-f6795011cab8da4fbf8e719f71d2028de1ca389e.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 ]