Skip to content

Commit

Permalink
tools.PkgConfig: honor PKG_CONFIG env var (#9627)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericLemanissier authored Oct 1, 2021
1 parent 71776c1 commit e8c2528
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions conans/client/tools/pkg_config.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -23,7 +23,7 @@ def __init__(self, library, pkg_config_executable='pkg-config', static=False, ms
: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
Expand Down

0 comments on commit e8c2528

Please sign in to comment.