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

Unified Diff: tools/gn/target.cc

Issue 2605963002: Stop propagation of dependent configs between toolchains. (Closed)
Patch Set: public_configs Created 4 years 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 | tools/gn/target_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/target.cc
diff --git a/tools/gn/target.cc b/tools/gn/target.cc
index 4430512877d033109fb9afaef859fb3b8fad1e8a..759d7bff14493e59663830c67f2259562eb28f11 100644
--- a/tools/gn/target.cc
+++ b/tools/gn/target.cc
@@ -352,8 +352,10 @@ bool Target::OnResolved(Err* err) {
// private deps. This step re-exports them as public configs for targets that
// depend on this one.
for (const auto& dep : public_deps_) {
- public_configs_.Append(dep.ptr->public_configs().begin(),
- dep.ptr->public_configs().end());
+ if (dep.ptr->toolchain() == toolchain()) {
+ public_configs_.Append(dep.ptr->public_configs().begin(),
+ dep.ptr->public_configs().end());
+ }
}
// Copy our own libs and lib_dirs to the final set. This will be from our
@@ -502,10 +504,17 @@ bool Target::GetOutputFilesForSource(const SourceFile& source,
}
void Target::PullDependentTargetConfigs() {
- for (const auto& pair : GetDeps(DEPS_LINKED))
- MergeAllDependentConfigsFrom(pair.ptr, &configs_, &all_dependent_configs_);
- for (const auto& pair : GetDeps(DEPS_LINKED))
- MergePublicConfigsFrom(pair.ptr, &configs_);
+ for (const auto& pair : GetDeps(DEPS_LINKED)) {
+ if (pair.ptr->toolchain() == toolchain()) {
+ MergeAllDependentConfigsFrom(pair.ptr, &configs_,
+ &all_dependent_configs_);
+ }
+ }
+ for (const auto& pair : GetDeps(DEPS_LINKED)) {
+ if (pair.ptr->toolchain() == toolchain()) {
+ MergePublicConfigsFrom(pair.ptr, &configs_);
+ }
+ }
}
void Target::PullDependentTargetLibsFrom(const Target* dep, bool is_public) {
« no previous file with comments | « no previous file | tools/gn/target_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698