depot/third_party/nixpkgs/pkgs/development/libraries/zchunk/0001-meson-fix-argp-standalone.patch
Default email c6ca5b8f13 Project import generated by Copybara.
GitOrigin-RevId: e4d49de45a3b5dbcb881656b4e3986e666141ea9
2022-07-18 18:21:45 +02:00

18 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