Index: build/config/linux/pkg_config.gni |
diff --git a/build/config/linux/pkg_config.gni b/build/config/linux/pkg_config.gni |
index 58769e26958ac066b0ed729a8dae6452739b9728..204cbab1d3be382984e1ac2d32ee40e7ddba3043 100644 |
--- a/build/config/linux/pkg_config.gni |
+++ b/build/config/linux/pkg_config.gni |
@@ -55,20 +55,24 @@ if (sysroot != "") { |
sysroot, |
"-a", |
current_cpu, |
- "--system_libdir", |
- system_libdir, |
] |
} else if (pkg_config != "") { |
pkg_config_args = [ |
"-p", |
pkg_config, |
- "--system_libdir", |
- system_libdir, |
] |
} else { |
pkg_config_args = [] |
} |
+# Only use the custom libdir when building with the default toolchain. |
+if (current_toolchain == default_toolchain) { |
+ pkg_config_args += [ |
+ "--system_libdir", |
+ system_libdir, |
+ ] |
+} |
+ |
template("pkg_config") { |
assert(defined(invoker.packages), |
"Variable |packages| must be defined to be a list in pkg_config.") |