From bda58e03a1ec1cbb160b88e60b0f8e625fef5aa9 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 5 Apr 2022 14:55:11 +0100 Subject: 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 --- meson.build | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'meson.build') diff --git a/meson.build b/meson.build index 5b63aa6..1f7d14e 100644 --- a/meson.build +++ b/meson.build @@ -101,12 +101,14 @@ configure_file( configuration : cdata, ) -if meson.is_subproject() - bwrapdir = get_option('libexecdir') +if meson.is_subproject() and get_option('program_prefix') == '' + error('program_prefix option must be set when bwrap is a subproject') +endif - if get_option('program_prefix') == '' - error('program_prefix option must be set when bwrap is a subproject') - endif +if get_option('bwrapdir') != '' + bwrapdir = get_option('bwrapdir') +elif meson.is_subproject() + bwrapdir = get_option('libexecdir') else bwrapdir = get_option('bindir') endif -- cgit v1.2.1