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}})" |
+} |