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

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

Issue 2664743002: Make __DATE__, __TIME__ and __TIMESTAMP__ to evaluate to an empty string. (Closed)
Patch Set: windows clang use the same rule with posix Created 3 years, 11 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 | « no previous file | no next file » | 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 4487e63aaf524f778740c667956dca8c8ed93fc7..16c8a7aed472f24b9fe00642cdc71b5d95975200 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -219,6 +219,26 @@ config("compiler") {
}
}
+ # Eliminate build metadata (__DATE__, __TIME__ and __TIMESTAMP__) for
+ # deterministic build. See https://crbug.com/314403
+ if (!is_official_build) {
+ if (is_win && !is_clang) {
+ cflags += [
+ "/wd4117", # Trying to define or undefine a predefined macro.
+ "/D__DATE__=",
+ "/D__TIME__=",
+ "/D__TIMESTAMP__=",
+ ]
+ } else {
+ cflags += [
+ "-Wno-builtin-macro-redefined",
+ "-D__DATE__=",
+ "-D__TIME__=",
+ "-D__TIMESTAMP__=",
+ ]
+ }
+ }
+
if (is_clang && is_debug) {
# Allow comparing the address of references and 'this' against 0
# in debug builds. Technically, these can never be null in
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698