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

Unified Diff: build/toolchain/toolchain.gni

Issue 1412623007: GN: Factor "stamp" and "copy" details out of toolchains (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 | « build/toolchain/mac/BUILD.gn ('k') | build/toolchain/win/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/toolchain/toolchain.gni
diff --git a/build/toolchain/toolchain.gni b/build/toolchain/toolchain.gni
index 5bd7d9c714bf6928c4e373da0093fb5e2e096496..e7f43792af1b4c76ce0f7666b583ed267a60f69e 100644
--- a/build/toolchain/toolchain.gni
+++ b/build/toolchain/toolchain.gni
@@ -38,3 +38,20 @@ if (is_posix) {
} else {
shlib_prefix = ""
}
+
+# While other "tool"s in a toolchain are specific to the target of that
+# toolchain, the "stamp" and "copy" tools are really generic to the host;
+# but each toolchain must define them separately. GN doesn't allow a
+# template instantiation inside a toolchain definition, so some boilerplate
+# has to be repeated in each toolchain to define these two tools. These
+# four variables reduce the duplication in that boilerplate.
+stamp_description = "STAMP {{output}}"
+copy_description = "COPY {{source}} {{output}}"
+if (host_os == "win") {
+ stamp_command = "$python_path gyp-win-tool stamp {{output}}"
+ copy_command =
+ "$python_path gyp-win-tool recursive-mirror {{source}} {{output}}"
+} else {
+ stamp_command = "touch {{output}}"
+ copy_command = "ln -f {{source}} {{output}} 2>/dev/null || (rm -rf {{output}} && cp -af {{source}} {{output}})"
+}
« no previous file with comments | « build/toolchain/mac/BUILD.gn ('k') | build/toolchain/win/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698