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

Unified Diff: base/BUILD.gn

Issue 1641413002: Makes GetBuildTime behave identically on all build types. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Response to #96 Created 4 years, 10 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 | base/base.gyp » ('j') | build/config/posix/BUILD.gn » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/BUILD.gn
diff --git a/base/BUILD.gn b/base/BUILD.gn
index 3bafc89ff1939bffd03a1e487233f4fd31d63a55..c35df4447239f5f2833a833833bb04bfea109cb4 100644
--- a/base/BUILD.gn
+++ b/base/BUILD.gn
@@ -24,6 +24,12 @@ import("//build/config/ui.gni")
import("//build/nocompile.gni")
import("//testing/test.gni")
+declare_args() {
+ # Override this value to give a specific build date.
+ # See //base/build_time.cc for more details.
+ override_build_date = "N/A"
+}
+
if (is_android) {
import("//build/config/android/rules.gni")
}
@@ -961,6 +967,7 @@ component("base") {
public_deps = [
":base_paths",
":base_static",
+ ":build_date",
":debugging_flags",
]
@@ -1875,6 +1882,31 @@ test("base_unittests") {
}
}
+action("build_date") {
+ script = "//build/write_build_date_header.py"
+
+ # Force recalculation if there's been a change.
+ inputs = [
+ "//build/util/LASTCHANGE",
+ ]
+ outputs = [
+ "$target_gen_dir/generated_build_date.h",
+ ]
+
+ args =
+ [ rebase_path("$target_gen_dir/generated_build_date.h", root_build_dir) ]
+
+ if (is_official_build) {
+ args += [ "official" ]
+ } else {
+ args += [ "default" ]
+ }
+
+ if (override_build_date != "N/A") {
+ args += [ override_build_date ]
+ }
+}
+
if (enable_nocompile_tests) {
nocompile_test("base_nocompile_tests") {
sources = [
« no previous file with comments | « no previous file | base/base.gyp » ('j') | build/config/posix/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698