Get gn analyze to respect changes to vs_toolchain.py
When changing the default compiler toolchain, either when changing
_GetDesiredVsToolchainHashes() or CURRENT_DEFAULT_TOOLCHAIN_VERSION,
it is important that gn analyze knows that this means that everything
needs rebuilding. This avoids having to use the blunt-hammer of
landmines.
R=dpranke@chromium.org
BUG=683729,555273
Review-Url: https://codereview.chromium.org/2780023002
Cr-Original-Commit-Position: refs/heads/master@{#460887}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: b62c0d449adee39905c8e0b7cd262f22502ae67a
diff --git a/tools/gn/analyzer.cc b/tools/gn/analyzer.cc
index 559287e..6e23c34 100644
--- a/tools/gn/analyzer.cc
+++ b/tools/gn/analyzer.cc
@@ -59,7 +59,9 @@
bool AnyBuildFilesWereModified(const SourceFileSet& source_files) {
for (auto* file : source_files) {
if (base::EndsWith(file->value(), ".gn", base::CompareCase::SENSITIVE) ||
- base::EndsWith(file->value(), ".gni", base::CompareCase::SENSITIVE))
+ base::EndsWith(file->value(), ".gni", base::CompareCase::SENSITIVE) ||
+ base::EndsWith(file->value(), "build/vs_toolchain.py",
+ base::CompareCase::SENSITIVE))
return true;
}
return false;
@@ -262,7 +264,7 @@
// TODO(crbug.com/555273): We can do smarter things when we detect changes
// to build files. For example, if all of the ninja files are unchanged,
- // we know that we can ignore changes to these files. Also, for most .gn
+ // we know that we can ignore changes to .gn* files. Also, for most .gn
// files, we can treat a change as simply affecting every target, config,
// or toolchain defined in that file.
if (AnyBuildFilesWereModified(inputs.source_files)) {