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

Unified Diff: build/config/linux/pkg_config.gni

Issue 2818523002: Introduce host_pkg_config variable for cross-compilation (Closed)
Patch Set: Cleanup of patchset #3 Created 3 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/linux/pkg_config.gni
diff --git a/build/config/linux/pkg_config.gni b/build/config/linux/pkg_config.gni
index 004405854b436b67f981a58809633eed2a439483..23cec376f08681c590a908e39efb8f535b0ec043 100644
--- a/build/config/linux/pkg_config.gni
+++ b/build/config/linux/pkg_config.gni
@@ -32,6 +32,9 @@ declare_args() {
# the sysroot mechanism to find the right .pc files.
pkg_config = ""
+ # A optional pkg-config wrapper to use for tools built on the host.
+ host_pkg_config = ""
+
# CrOS systemroots place pkgconfig files at <systemroot>/usr/share/pkgconfig
# and one of <systemroot>/usr/lib/pkgconfig or <systemroot>/usr/lib64/pkgconfig
# depending on whether the systemroot is for a 32 or 64 bit architecture.
@@ -73,11 +76,24 @@ if (target_sysroot != "" && sysroot == target_sysroot) {
]
}
+if (host_pkg_config != "") {
+ host_pkg_config_args = [
+ "-p",
+ host_pkg_config,
+ ]
+} else {
+ host_pkg_config_args = pkg_config_args
+}
+
template("pkg_config") {
assert(defined(invoker.packages),
"Variable |packages| must be defined to be a list in pkg_config.")
config(target_name) {
- args = pkg_config_args + invoker.packages
+ if (host_toolchain == current_toolchain) {
+ args = host_pkg_config_args + invoker.packages
+ } else {
+ args = pkg_config_args + invoker.packages
+ }
if (defined(invoker.extra_args)) {
args += invoker.extra_args
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698