summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorericLemanissier <ericLemanissier@users.noreply.github.com>2021-10-01 10:26:18 +0200
committerGitHub <noreply@github.com>2021-10-01 10:26:18 +0200
commite8c2528df3a90c22f8a26969bf7511e66f863969 (patch)
tree37c36743a9289c26adaaa536c78a49fba4b3b5e9
parent71776c1aed3da0e8460cb34c1fc013d44bb25d4d (diff)
tools.PkgConfig: honor PKG_CONFIG env var (#9627)
-rw-r--r--conans/client/tools/pkg_config.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/conans/client/tools/pkg_config.py b/conans/client/tools/pkg_config.py
index 9c84b80d..6184292d 100644
--- a/conans/client/tools/pkg_config.py
+++ b/conans/client/tools/pkg_config.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-import subprocess
+import subprocess, os
from conans.errors import ConanException
from conans.util.runners import check_output_runner
@@ -12,7 +12,7 @@ class PkgConfig(object):
def _cmd_output(command):
return check_output_runner(command).strip()
- def __init__(self, library, pkg_config_executable='pkg-config', static=False, msvc_syntax=False, variables=None,
+ def __init__(self, library, pkg_config_executable=None, static=False, msvc_syntax=False, variables=None,
print_errors=True):
"""
:param library: library (package) name, such as libastral
@@ -23,7 +23,7 @@ class PkgConfig(object):
:param print_errors: output error messages (adds --print-errors)
"""
self.library = library
- self.pkg_config_executable = pkg_config_executable
+ self.pkg_config_executable = pkg_config_executable or os.getenv('PKG_CONFIG', 'pkg-config')
self.static = static
self.msvc_syntax = msvc_syntax
self.define_variables = variables