From cf9d81dbe0eadbadcc81b2565ce73e7eff26f982 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 4 Jul 2022 17:23:48 +0200 Subject: Switch to using libpkg-config instead of libpkgconf by default The use of (now deprecated) libpkgconf is still possible by setting config.build2.libpkgconf to true. Note that libpkgconf is known to have issues on Windows and Mac OS so this should only be used on Linux and maybe BSDs. Also note that we will only keep this until upstream (again) breaks backwards compatibility at which point we will drop this support. --- libbuild2/cc/pkgconfig.hxx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'libbuild2/cc/pkgconfig.hxx') diff --git a/libbuild2/cc/pkgconfig.hxx b/libbuild2/cc/pkgconfig.hxx index 3ea9e2e..7959da1 100644 --- a/libbuild2/cc/pkgconfig.hxx +++ b/libbuild2/cc/pkgconfig.hxx @@ -9,7 +9,11 @@ // #ifndef BUILD2_BOOTSTRAP -#include +#ifndef BUILD2_LIBPKGCONF +# include +#else +# include +#endif #include #include @@ -74,11 +78,13 @@ namespace build2 void free (); - // Keep them as raw pointers not to deal with API thread-unsafety in - // deleters and introducing additional mutex locks. - // +#ifndef BUILD2_LIBPKGCONF + pkg_config_client_t* client_ = nullptr; + pkg_config_pkg_t* pkg_ = nullptr; +#else pkgconf_client_t* client_ = nullptr; pkgconf_pkg_t* pkg_ = nullptr; +#endif }; inline pkgconfig:: -- cgit v1.1