Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5379)

Unified Diff: build/config/linux/pkg-config.py

Issue 147923010: Work on Clang for pure GN build. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | build/config/linux/pkg_config.gni » ('j') | build/toolchain/linux/BUILD.gn » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/linux/pkg-config.py
diff --git a/build/config/linux/pkg-config.py b/build/config/linux/pkg-config.py
index c1c0dc4f54c3dee2249ba78db0f217e2c51ce010..70cb5e961a00b81b9644e3c3e5234ce407c740a0 100644
--- a/build/config/linux/pkg-config.py
+++ b/build/config/linux/pkg-config.py
@@ -12,8 +12,8 @@ from optparse import OptionParser
# This script runs pkg-config, optionally filtering out some results, and
# returns the result.
#
-# The result will be [ <includes>, <cflags>, <libs>, <lib_dirs> ] where each
-# member is itself a list of strings.
+# The result will be [ <includes>, <cflags>, <libs>, <lib_dirs>, <ldflags> ]
+# where each member is itself a list of strings.
#
# You can filter out matches using "-v <regexp>" where all results from
# pkgconfig matching the given regular expression will be ignored. You can
@@ -138,6 +138,7 @@ includes = []
cflags = []
libs = []
lib_dirs = []
+ldflags = []
for flag in all_flags[:]:
if len(flag) == 0 or MatchesAnyRegexp(flag, strip_out):
@@ -145,14 +146,21 @@ for flag in all_flags[:]:
if flag[:2] == '-l':
libs.append(RewritePath(flag[2:], prefix, sysroot))
- if flag[:2] == '-L':
+ elif flag[:2] == '-L':
lib_dirs.append(RewritePath(flag[2:], prefix, sysroot))
elif flag[:2] == '-I':
includes.append(RewritePath(flag[2:], prefix, sysroot))
+ elif flag[:3] == '-Wl':
+ ldflags.append(flag)
+ elif flag == '-pthread':
+ # Many libs specify "-pthread" which we don't need since we always include
+ # this anyway. Removing it here prevents a bunch of duplicate inclusions on
+ # the command line.
+ pass
else:
cflags.append(flag)
# Output a GN array, the first one is the cflags, the second are the libs. The
# JSON formatter prints GN compatible lists when everything is a list of
# strings.
-print json.dumps([includes, cflags, libs, lib_dirs])
+print json.dumps([includes, cflags, libs, lib_dirs, ldflags])
« no previous file with comments | « no previous file | build/config/linux/pkg_config.gni » ('j') | build/toolchain/linux/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698