3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/libraries/zchunk/0001-meson-fix-argp-standalone.patch
2022-07-14 20:51:22 -04:00

19 lines
921 B
Diff

diff --git a/meson.build b/meson.build
index 1c6b32d..aa7dd25 100644
--- a/meson.build
+++ b/meson.build
@@ -58,10 +58,10 @@ endif
# argp-standalone dependency (if required)
if build_machine.system() == 'windows' or build_machine.system() == 'darwin' or build_machine.system() == 'freebsd' or not cc.links('#include <argp.h>\nstatic error_t parse_opt (int key, char *arg, struct argp_state *state) { argp_usage(state); return 0; }; void main() {}')
- if fs.is_dir(join_paths([get_option('prefix'), 'include']))
- inc += include_directories(join_paths([get_option('prefix'), 'include']))
+ argplib = cc.find_library('argp', has_headers : ['argp.h'], required: false)
+ if not argplib.found()
+ argplib = dependency('argp-standalone')
endif
- argplib = cc.find_library('argp', dirs : join_paths([get_option('prefix'), 'lib']))
else
argplib = dependency('', required : false)
endif