diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2022-07-04 17:23:48 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2022-07-05 12:26:29 +0200 |
commit | cf9d81dbe0eadbadcc81b2565ce73e7eff26f982 (patch) | |
tree | 5654dc2802a87d2a2126e23d203540f74a8ae6e9 /libbuild2/cc/buildfile | |
parent | db2cf5ca0348788bfd8b3052c03279db1d971d2f (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/buildfile')
-rw-r--r-- | libbuild2/cc/buildfile | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/libbuild2/cc/buildfile b/libbuild2/cc/buildfile index e98e3de..e090e76 100644 --- a/libbuild2/cc/buildfile +++ b/libbuild2/cc/buildfile @@ -6,15 +6,24 @@ include ../ impl_libs = ../lib{build2} # Implied interface dependency. -import impl_libs += libpkgconf%lib{pkgconf} +libpkgconf = $config.build2.libpkgconf + +if $libpkgconf + import impl_libs += libpkgconf%lib{pkgconf} +else + import impl_libs += libpkg-config%lib{pkg-config} include ../bin/ intf_libs = ../bin/lib{build2-bin} -./: lib{build2-cc}: libul{build2-cc}: {hxx ixx txx cxx}{** -**.test...} \ - h{msvc-setup} \ +./: lib{build2-cc}: libul{build2-cc}: \ + {hxx ixx txx cxx}{** -pkgconfig-lib* -**.test...} \ + h{msvc-setup} \ $intf_libs $impl_libs +libul{build2-cc}: cxx{pkgconfig-libpkgconf}: include = $libpkgconf +libul{build2-cc}: cxx{pkgconfig-libpkg-config}: include = (!$libpkgconf) + # Unit tests. # exe{*.test}: @@ -38,6 +47,9 @@ for t: cxx{**.test...} obja{*}: cxx.poptions += -DLIBBUILD2_CC_STATIC_BUILD objs{*}: cxx.poptions += -DLIBBUILD2_CC_SHARED_BUILD +if $libpkgconf + cxx.poptions += -DBUILD2_LIBPKGCONF + if ($cxx.target.class == 'windows') cxx.libs += $regex.apply(advapi32 ole32 oleaut32, \ '(.+)', \ |