meson: fix build of executables with nonstandard libarchive path

The libarchive header is used in alpm.h, and several binaries include
this header. This is noticeably a problem when using e.g. the musl-gcc
compiler which does not include /usr/include by default, and thus the
build system reports:

...../lib/libalpm/alpm.h:35:10: fatal error: archive.h: No such file or directory

More commonly, this will result in compiling against potentially the
wrong headers, if the libarchive installation picked up by pkg-config is
different from the one with headers in /usr/include, and /usr/include is
in the -isystem path.

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Eli Schwartz 2019-04-14 20:56:17 -04:00 committed by Allan McRae
parent 6911904a03
commit 583f3122ce

View file

@ -387,6 +387,7 @@ executable(
pacman_conf_sources, pacman_conf_sources,
include_directories : includes, include_directories : includes,
link_with : [libalpm], link_with : [libalpm],
dependencies : [libarchive],
install : true, install : true,
) )
@ -395,6 +396,7 @@ executable(
testpkg_sources, testpkg_sources,
include_directories : includes, include_directories : includes,
link_with : [libalpm], link_with : [libalpm],
dependencies : [libarchive],
install : true, install : true,
) )