From: Jonathan Dieter Date: Sat, 8 Jan 2022 21:57:24 +0000 (+0000) Subject: Verify that include directory exists before trying to include it X-Git-Tag: archive/raspbian/1.2.1+ds1-1+rpi1^2~7^2~1^2~9^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a03311cd6cff69fb96ebd04b84ab0994c2c90105;p=zchunk.git Verify that include directory exists before trying to include it Note that this also bumps the minimum meson version to 0.53.0 Signed-off-by: Jonathan Dieter --- diff --git a/meson.build b/meson.build index ce90ac8..ced4233 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project( 'zck', 'c', version : '1.1.16', - meson_version : '>=0.44.0', + meson_version : '>=0.53.0', default_options : ['c_std=gnu99'] ) @@ -10,6 +10,7 @@ so_version = '1' common_cflags = [ '-Wunused-result', ] +fs = import('fs') cc = meson.get_compiler('c') add_project_arguments(cc.get_supported_arguments(common_cflags), language : 'c') @@ -60,7 +61,9 @@ if host_machine.system() == 'windows' endif if build_machine.system() == 'windows' or build_machine.system() == 'darwin' or build_machine.system() == 'freebsd' or not cc.links('#include \nstatic error_t parse_opt (int key, char *arg, struct argp_state *state) { argp_usage(state); return 0; }; void main() {}') - inc += include_directories(join_paths([get_option('prefix'), 'include'])) + if fs.is_dir(join_paths([get_option('prefix'), 'include'])) + inc += include_directories(join_paths([get_option('prefix'), 'include'])) + endif argplib = cc.find_library('argp', dirs : join_paths([get_option('prefix'), 'lib'])) else argplib = dependency('', required : false)