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

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

Issue 723343002: Update from https://crrev.com/304121 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | « build/config/linux/pkg-config.py ('k') | build/config/ui.gni » ('j') | 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 378863e95510d08244dcebb27ccb4b9e527a84c7..687afc51c853ddf40dfb5390c1da19819eb894e7 100644
--- a/build/config/linux/pkg_config.gni
+++ b/build/config/linux/pkg_config.gni
@@ -33,25 +33,29 @@ declare_args() {
pkg_config = ""
}
+pkg_config_script = "//build/config/linux/pkg-config.py"
+
+# Define the args we pass to the pkg-config script for other build files that
+# need to invoke it manually.
+if (sysroot != "") {
+ # Pass the sysroot if we're using one (it requires the CPU arch also).
+ pkg_config_args = ["-s", sysroot, "-a", cpu_arch]
+} else if (pkg_config != "") {
+ pkg_config_args = ["-p", pkg_config]
+} else {
+ 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) {
- if (sysroot != "") {
- # Pass the sysroot if we're using one (it requires the CPU arch also).
- args = ["-s", sysroot, "-a", cpu_arch] + invoker.packages
- } else if (pkg_config != "") {
- args = ["-p", pkg_config] + invoker.packages
- } else {
- args = invoker.packages
- }
-
+ args = pkg_config_args + invoker.packages
if (defined(invoker.extra_args)) {
args += invoker.extra_args
}
- pkgresult = exec_script("//build/config/linux/pkg-config.py",
- args, "value")
+ pkgresult = exec_script(pkg_config_script, args, "value")
include_dirs = pkgresult[0]
cflags = pkgresult[1]
« no previous file with comments | « build/config/linux/pkg-config.py ('k') | build/config/ui.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698