build: allow building without help in meson
parent
718e07f78a
commit
f6795011ca
|
@ -12,6 +12,7 @@ apk_libdir = get_option('libdir')
|
||||||
|
|
||||||
zlib_dep = dependency('zlib')
|
zlib_dep = dependency('zlib')
|
||||||
openssl_dep = dependency('openssl')
|
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'))
|
lua_dep = dependency('lua' + get_option('lua_version'), required: get_option('lua'))
|
||||||
scdoc_dep = dependency('scdoc', version: '>=1.10', required: get_option('docs'))
|
scdoc_dep = dependency('scdoc', version: '>=1.10', required: get_option('docs'))
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
option('docs', description: 'Build manpages with scdoc', type: 'feature', value: 'auto')
|
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', description: 'Build luaapk (lua bindings)', type: 'feature', value: 'auto')
|
||||||
option('lua_version', description: 'Lua version to build against', type: 'string', value: '5.3')
|
option('lua_version', description: 'Lua version to build against', type: 'string', value: '5.3')
|
||||||
|
|
|
@ -54,6 +54,7 @@ apk_src = [
|
||||||
'help.c',
|
'help.c',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if lua_bin.found()
|
||||||
genhelp_script = find_program('genhelp.lua')
|
genhelp_script = find_program('genhelp.lua')
|
||||||
|
|
||||||
generated_help = custom_target(
|
generated_help = custom_target(
|
||||||
|
@ -63,6 +64,14 @@ generated_help = custom_target(
|
||||||
input: man_files,
|
input: man_files,
|
||||||
command: [genhelp_script, '@INPUT@'],
|
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 ]
|
apk_src += [ generated_help ]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue