Merge pull request #6138 from jameshilliard/fix-pkg-config

Search pkgconf system libs/cflags
This commit is contained in:
Andrew Murray 2022-05-02 21:09:45 +10:00 committed by GitHub
commit 0a30e431d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -250,10 +250,14 @@ def _cmd_exists(cmd):
def _pkg_config(name):
try:
command = os.environ.get("PKG_CONFIG", "pkg-config")
for keep_system in (True, False):
try:
command_libs = [command, "--libs-only-L", name]
command_cflags = [command, "--cflags-only-I", name]
if keep_system:
command_libs.append("--keep-system-libs")
command_cflags.append("--keep-system-cflags")
if not DEBUG:
command_libs.append("--silence-errors")
command_cflags.append("--silence-errors")