meson: Allow installation directory to be set explicitly

Overriding the libexecdir via default_options doesn't always work when
used as a subproject.

Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
Simon McVittie
2022-04-05 14:55:11 +01:00
parent 34a8c8bc87
commit bda58e03a1
2 changed files with 12 additions and 5 deletions

View File

@@ -101,12 +101,14 @@ configure_file(
configuration : cdata,
)
if meson.is_subproject()
bwrapdir = get_option('libexecdir')
if get_option('program_prefix') == ''
if meson.is_subproject() and get_option('program_prefix') == ''
error('program_prefix option must be set when bwrap is a subproject')
endif
endif
if get_option('bwrapdir') != ''
bwrapdir = get_option('bwrapdir')
elif meson.is_subproject()
bwrapdir = get_option('libexecdir')
else
bwrapdir = get_option('bindir')
endif

View File

@@ -10,6 +10,11 @@ option(
description : 'install bash completion script in this directory',
value : '',
)
option(
'bwrapdir',
type : 'string',
description : 'install bwrap in this directory [default: bindir, or libexecdir in subprojects]',
)
option(
'man',
type : 'feature',