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

Unified Diff: build/config/compiler/BUILD.gn

Issue 3010023002: Reland: [infra] Roll clang toolchain forward (Closed)
Patch Set: Created 3 years, 3 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 | « DEPS ('k') | build/toolchain/android/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/compiler/BUILD.gn
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index 52256f5dfc047fb9b499b7b21741ddd01a9a1538..b999f2b52b100e6fc67940dabcfda92d03be7e4e 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -329,6 +329,20 @@ config("compiler") {
}
}
+ # We want to force a recompile and relink of the world whenever our toolchain
+ # changes since artifacts from an older version of the toolchain may or may
+ # not be compatible with newer ones. To achieve this, we insert a synthetic
+ # define into the compile line.
+ if (is_clang && (is_linux || is_mac)) {
+ if (is_linux) {
+ toolchain_stamp_file = "//buildtools/linux64/clang.stamp"
+ } else {
+ toolchain_stamp_file = "//buildtools/mac/clang.stamp"
+ }
+ toolchain_version = read_file(toolchain_stamp_file, "trim string")
+ defines = [ "TOOLCHAIN_VERSION=$toolchain_version" ]
+ }
+
# Assign any flags set for the C compiler to asmflags so that they are sent
# to the assembler. The Windows assembler takes different types of flags
# so only do so for posix platforms.
« no previous file with comments | « DEPS ('k') | build/toolchain/android/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698