aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/pkgconfig.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-07-04 17:23:48 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-07-05 12:26:29 +0200
commitcf9d81dbe0eadbadcc81b2565ce73e7eff26f982 (patch)
tree5654dc2802a87d2a2126e23d203540f74a8ae6e9 /libbuild2/cc/pkgconfig.hxx
parentdb2cf5ca0348788bfd8b3052c03279db1d971d2f (diff)
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.
Diffstat (limited to 'libbuild2/cc/pkgconfig.hxx')
-rw-r--r--libbuild2/cc/pkgconfig.hxx14
1 files changed, 10 insertions, 4 deletions
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 <libpkgconf/libpkgconf.h>
+#ifndef BUILD2_LIBPKGCONF
+# include <libpkg-config/pkg-config.h>
+#else
+# include <libpkgconf/libpkgconf.h>
+#endif
#include <libbuild2/types.hxx>
#include <libbuild2/utility.hxx>
@@ -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::