Skip to content

Commit 02fdf5c

Browse files
bnoordhuistargos
authored andcommitted
build: don't swallow pkg-config warnings
PR-URL: #28118 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Refael Ackermann (רפאל פלחי) <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent df9b253 commit 02fdf5c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

configure.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -628,18 +628,20 @@ def pkg_config(pkg):
628628
Returns ("-l flags", "-I flags", "-L flags", "version")
629629
otherwise (None, None, None, None)"""
630630
pkg_config = os.environ.get('PKG_CONFIG', 'pkg-config')
631+
args = [] # Print pkg-config warnings on first round.
631632
retval = ()
632633
for flag in ['--libs-only-l', '--cflags-only-I',
633634
'--libs-only-L', '--modversion']:
635+
args += [flag, pkg]
634636
try:
635-
proc = subprocess.Popen(
636-
shlex.split(pkg_config) + ['--silence-errors', flag, pkg],
637-
stdout=subprocess.PIPE)
637+
proc = subprocess.Popen(shlex.split(pkg_config) + args,
638+
stdout=subprocess.PIPE)
638639
val = proc.communicate()[0].strip()
639640
except OSError as e:
640641
if e.errno != errno.ENOENT: raise e # Unexpected error.
641642
return (None, None, None, None) # No pkg-config/pkgconf installed.
642643
retval += (val,)
644+
args = ['--silence-errors']
643645
return retval
644646

645647

0 commit comments

Comments
 (0)